-
Notifications
You must be signed in to change notification settings - Fork 3.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
[testharness.js] Report error for worker errors #11400
Conversation
--- a/resources/testharness.js
+++ b/resources/testharness.js
@@ -2982,16 +2982,17 @@ policies and contribution forms [3].
test.phase = test.phases.HAS_RESULT;
test.done();
} else if (!tests.allow_uncaught_exception) {
tests.status.status = tests.status.ERROR;
tests.status.message = e.message;
tests.status.stack = stack;
}
done();
+ e.preventDefault();
};
addEventListener("error", error_handler, false);
addEventListener("unhandledrejection", function(e){ error_handler(e.reason); }, false);
}
test_environment.on_tests_ready();
|
Thanks, used that instead. |
@Ms2ger ping |
I think that looks good? |
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.
blah
79b96c4
to
47708a5
Compare
There are no owners for this pull request. Please reach out on W3C's irc server (irc.w3.org, port 6665) on channel #testing (web client) to get help with this. Thank you! |
This seems like it may be genuine:
|
I think what happens is that the error worker runs first and sets the harness status to ERROR. Fix for that is #11405 |
It looks as though the behavior in In To summarize: In To fix the tests, I've added a sub-test to Although @Ms2ger's recommended solution satisfies both of these tests, I have @zcorpan will be out of office for a few more weeks. @Ms2ger Would you mind |
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.
Do squash the commits before merging, and update the PR title.
@@ -1,3 +1,8 @@ | |||
importScripts("/resources/testharness.js"); | |||
|
|||
// The following sub-test ensures that the worker is not interpreted as a | |||
// single-page test. The subsequent uncaught exception should therefor be |
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.
therefore
Ensure that uncaught exceptions in typical worker tests cause the harness to report an ERROR status, and update the corresponding test accordingly. Add a test to verify that the harness reports an OK status in response to uncaught exceptions which originate from "single-page test" workers.
be58932
to
f4009c7
Compare
Thanks, @Ms2ger. Typically, I would land this as a series of distinct commits to preserve authorship information. However, because the final changeset does not contain @zcorpan's modification, I've squashed it down into a single commit. And because GitHub.com has been configured to disallow commits pushed from local repositories, I've force-pushed the result to this branch. For posterity, the pre-squashed version is available here: zcorpan/remote-done-twice-error...bocoup:zcorpan/remote-done-twice-error |
Looks like I forgot to use git's |
In resources/test/tests/functional/worker-dedicated.html remote_done
ends up being called twice, and the second time message_target is
null, which causes an exception to be thrown.