-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Fix orphaned browser processes due to uncaught exceptions in the tests #18401
Fix orphaned browser processes due to uncaught exceptions in the tests #18401
Conversation
I have applied the following diff: diff --git a/test/integration-boot.mjs b/test/integration-boot.mjs
index 4e04bb6f1..332c97a50 100644
--- a/test/integration-boot.mjs
+++ b/test/integration-boot.mjs
@@ -20,6 +20,8 @@ async function runTests(results) {
jasmine.exitOnCompletion = false;
jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
+ throw new Error("Yikes, something unexpected happened");
+
jasmine.loadConfig({
random: false,
spec_dir: "integration" Before this patch
After this patch
Not only does this therefore fix the problem of hanging browser windows, but it also makes the logs more concise/actionable by removing noise from the uncaught exception propagating. |
If uncaught exceptions occur in the tests (which happened in mozilla#17962 and can be triggered manually by throwing an error in `integration-boot.js`) the teardown logic of the tests doesn't get to run and thus spawned browser processes are not closed properly. Given that `test.mjs` is the only process that has a reference to them they will become orphaned and keep running if `test.mjs` exits without explicitly closing them. This commit fixes the issue by always closing the browsers if uncaught exceptions occur, and we make sure to log them for debugging purposes.
3d31da5
to
3afe2d3
Compare
/botio unittest |
From: Bot.io (Windows)ReceivedCommand cmd_unittest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/0936bcbf5dcdb06/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/30305e1c62e43f7/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/30305e1c62e43f7/output.txt Total script time: 2.47 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/0936bcbf5dcdb06/output.txt Total script time: 7.07 mins
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/e39aa1e1bb10d5a/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/481c711563dfae6/output.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me, thank you!
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/e39aa1e1bb10d5a/output.txt Total script time: 7.96 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/481c711563dfae6/output.txt Total script time: 16.95 mins
|
If uncaught exceptions occur in the tests (which happened in #17962 and can be triggered manually by throwing an error in
integration-boot.js
) the teardown logic of the tests doesn't get to run and thus spawned browser processes are not closed properly. Given thattest.mjs
is the only process that has a reference to them they will become orphaned and keep running iftest.mjs
exits without explicitly closing them.This commit fixes the issue by always closing the browsers if uncaught exceptions occur, and we make sure to log them for debugging purposes.
Unblocks #17962.
This patch is ever so slightly easier to review with the
?w=1
flag: https://github.com/mozilla/pdf.js/pull/18401/files?w=1.