Open
Conversation
3b27b49 to
6bcc679
Compare
Contributor
Author
|
You can run this test easily with until-death: until-death npm testFor me it'll pass 2-3 times before failing: % until-death npm test
> node-datachannel@0.29.0 test
> NODE_OPTIONS=--experimental-vm-modules jest
PASS test/jest-tests/basic.test.ts
PASS test/jest-tests/p2p.test.ts
PASS test/jest-tests/streams.test.ts
FAIL test/jest-tests/polyfill.test.ts
● polyfill › it should receive lots of data
expect(received).toEqual(expected) // deep equality
Expected: 10485760
Received: 10229760
379 | ]);
380 |
> 381 | expect(received).toEqual(bytes);
| ^
382 |
383 | peer1.close();
384 | peer2.close();
at Object.<anonymous> (test/jest-tests/polyfill.test.ts:381:22)
PASS test/jest-tests/websocket.test.ts
A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.
Test Suites: 1 failed, 4 passed, 5 total
Tests: 1 failed, 11 passed, 12 total
Snapshots: 0 total
Time: 4.467 s
Ran all test suites.
file:///Users/alex/.nvm/versions/node/v22.11.0/lib/node_modules/until-death/node_modules/execa/lib/error.js:60
error = new Error(message);
^
Error: Command failed with exit code 1: npm test
at makeError (file:///Users/alex/.nvm/versions/node/v22.11.0/lib/node_modules/until-death/node_modules/execa/lib/error.js:60:11)
at handlePromise (file:///Users/alex/.nvm/versions/node/v22.11.0/lib/node_modules/until-death/node_modules/execa/index.js:124:26)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async file:///Users/alex/.nvm/versions/node/v22.11.0/lib/node_modules/until-death/index.js:10:3 {
shortMessage: 'Command failed with exit code 1: npm test',
command: 'npm test',
escapedCommand: 'npm test',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
cwd: '/Users/alex/Documents/Workspaces/murat-dogan/node-datachannel',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
Node.js v22.11.0 |
Adds a test that opens a datachannel. When the remote receives notification of the new channel it writes lots of data into it and closes the channel. The local peer counts the received bytes and asserts that it received them all. This test currently fails intermittently, largely down to the amount of load the process is under at the time. You can run similar code in a browser here: https://codepen.io/achingbrain/pen/KwVPZBP?editors=0012 This works in Chrome and Firefox Nightly, though Firefox is a bit slow.
6bcc679 to
46b17ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a test that opens a datachannel. When the remote receives notification of the new channel it writes lots of data into it and closes the channel. The local peer counts the received bytes and asserts that it received them all.
This test currently fails intermittently, largely down to the amount of load the process is under at the time.
You can run similar code in a browser here: https://codepen.io/achingbrain/pen/KwVPZBP?editors=0012
This works in Chrome and Firefox Nightly, though Firefox is quite slow, it takes about 12s for me vs 0.5s for Chrome.