-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test-PipeTransport.ts randomly fails #1374
Comments
I've taken a look to all tests in which we call |
Here another unrelated PR in which same test is failing: https://github.com/versatica/mediasoup/actions/runs/8788437337/job/24115870840?pr=1380#step:7:60 |
Line 1265 in 0cb131c
The error seems to occur if the test ends without waiting for this pause promise to fully complete. This is more likely to occur in slow running environments. It seems possible to work around this by delaying the completion of the test a bit, but I think the correct approach is to wait for this completion if possible.
|
Very good point! And the issue is reproducible locally doing this change: diff --git a/node/src/Router.ts b/node/src/Router.ts
index c60476805..33dfc343a 100644
--- a/node/src/Router.ts
+++ b/node/src/Router.ts
@@ -1262,9 +1262,15 @@ export class Router<
// Pipe events from the pipe Consumer to the pipe Producer.
pipeConsumer!.observer.on('close', () => pipeProducer!.close());
- pipeConsumer!.observer.on('pause', () => pipeProducer!.pause());
- pipeConsumer!.observer.on('resume', () => pipeProducer!.resume());
-
+ console.log('UNCOMMENT AND REMOVE');
+ // pipeConsumer!.observer.on('pause', () => pipeProducer!.pause());
+ pipeConsumer!.observer.on('pause', () =>
+ setTimeout(() => pipeProducer!.pause(), 1000)
+ );
+ // pipeConsumer!.observer.on('resume', () => pipeProducer!.resume());
+ pipeConsumer!.observer.on('resume', () =>
+ setTimeout(() => pipeProducer!.resume(), 1000)
+ );
// Pipe events from the pipe Producer to the pipe Consumer.
pipeProducer.observer.on('close', () => pipeConsumer!.close()); and then: npx jest --testPathPattern node/src/test/test-PipeTransport.ts |
* v3: chore: Update Rust toolchain channel to version 1.79.0 Fix issue versatica#1374 cosmetic fix Simulcast IncreaseLayer bug when producer score is zero (versatica#1410) Update NPM deps TcpConnectionHandle.cpp: properly close handle fix asan error for new-delete-type-mismatch (versatica#1411)
As shown in CI: https://github.com/versatica/mediasoup/actions/runs/8619867847/job/23625492760?pr=1373
Note that we already had these kind of errors in the past and, in same cases, they were produced by other tests that were still running code once completed.
The text was updated successfully, but these errors were encountered: