Closed
Bug 885107
Opened 11 years ago
Closed 11 years ago
testharness.js should deal with uncaught exceptions
Categories
(Testing :: Mochitest, defect)
Testing
Mochitest
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla27
People
(Reporter: emk, Assigned: emk)
References
Details
Attachments
(2 files, 4 obsolete files)
(deleted),
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Ms2ger
:
review+
RyanVM
:
feedback+
|
Details | Diff | Splinter Review |
I noticed this when I'm writing a test for bug 851982.
SimpleTest.expectAssertions() will throw ReferenceError in testharness tests because testharness won't define the global variable SimpleTest. Even worse, testharness driver didn't catch the failure. So the test will "pass" even if it is not actually executed.
Comment 1•11 years ago
|
||
I wouldn't say that bug 404077 broke testharness.js tests in general, but one test annotation done as part of bug 404077 broke a single test because the testharness.js wrapper fails to report toplevel exceptions, and thus I didn't notice that the annotation broke the test. Or am I missing something here?
Summary: Bug 404077 effectively broke mozharness tests → Bug 404077 effectively broke testharness.js tests
Assignee | ||
Comment 2•11 years ago
|
||
Right, testharness.js should deal with toplevel exceptions.
Comment 3•11 years ago
|
||
They don't, by design.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Assignee | ||
Comment 4•11 years ago
|
||
Then how can we detect silently disabled tests?
Comment 5•11 years ago
|
||
I think that design is unacceptable. If it remains the case, I think we'll need to discourage people from writing testharness.js tests because of this issue.
The design aspect doesn't need to be applied to the W3C part; I'd think it could be in our extra integration script.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Assignee | ||
Comment 6•11 years ago
|
||
Perhaps testharnessreport.js?
Summary: Bug 404077 effectively broke testharness.js tests → Bug 404077 effectively broke testharnessreport.js tests
Assignee | ||
Updated•11 years ago
|
Summary: Bug 404077 effectively broke testharnessreport.js tests → testharnessreport.js should deal with uncaught exceptions
Comment 7•11 years ago
|
||
Yes, that's the file I meant by "extra integration script".
Comment 8•11 years ago
|
||
Would it be enough if testharness.js installed an onerror handler that set the overall harness status to "error" if there was an uncaught exception? It could also report that in the visual output of course.
I am slightly worried that this will prove to be a non-backward-compatible change, but I can at least try and see if it breaks things.
Assignee | ||
Comment 9•11 years ago
|
||
I already tried and found that an existing imported test had a bug. (See bug 885765.)
This was not a test incompatibility but a proof of the ability to find broken tests.
Comment 10•11 years ago
|
||
OK, do you have a patch that you can turn into a PR at [1]?
[1] https://github.com/w3c/testharness.js
Assignee | ||
Comment 11•11 years ago
|
||
I took a safer approach (changed our integration script instead of testharness.js itself).
Comment 12•11 years ago
|
||
Work in progress patch for upstream:
https://github.com/jgraham/testharness.js/commit/caf73d4154144a7c2398ec07498ff11ef9b7aa96
Still needs documentation, but please try it out and report back any errors. You need to ensure that your testharnessreport.js checks the overall harness status as well as the individual test status.
Comment 13•11 years ago
|
||
(In reply to jgraham from comment #12)
> Work in progress patch for upstream:
>
> https://github.com/jgraham/testharness.js/commit/
> caf73d4154144a7c2398ec07498ff11ef9b7aa96
>
> Still needs documentation, but please try it out and report back any errors.
> You need to ensure that your testharnessreport.js checks the overall harness
> status as well as the individual test status.
It already does that.
Comment 14•11 years ago
|
||
testharness.js review request: https://critic.hoppipolla.co.uk/r/203
Comment 15•11 years ago
|
||
trstharness.js patch pushed: https://github.com/w3c/testharness.js/commit/103f3c0
Assignee | ||
Comment 16•11 years ago
|
||
I tried to update testharness, but I got the following error:
https://tbpl.mozilla.org/php/getParsedLog.php?id=24997587#error0
"members.any" was "members.some" before the update.
Assignee | ||
Comment 17•11 years ago
|
||
updateTestharness.py points the following repo:
https://dvcs.w3.org/hg/resources
It has a fix for the above error:
https://dvcs.w3.org/hg/resources/diff/06cab30bcee2/idlharness.js
But this fix is not reflected to the GitHub repo.
On the other hand, dvcs.w3.org repo don't contain the windows.onerror things.
Which is the correct, latest, official testharness repo?
Flags: needinfo?(james)
Flags: needinfo?(ayg)
Comment 18•11 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #17)
> updateTestharness.py points the following repo:
> https://dvcs.w3.org/hg/resources
> It has a fix for the above error:
> https://dvcs.w3.org/hg/resources/diff/06cab30bcee2/idlharness.js
> But this fix is not reflected to the GitHub repo.
> On the other hand, dvcs.w3.org repo don't contain the windows.onerror things.
>
> Which is the correct, latest, official testharness repo?
The github one. If there is a bug in that repo fixed in the old dvcs.w3.org one the patch needs to be ported across.
Flags: needinfo?(james)
Flags: needinfo?(ayg)
Comment 19•11 years ago
|
||
Pushed the patch for that bug.
Assignee | ||
Comment 20•11 years ago
|
||
Attachment #771485 -
Attachment is obsolete: true
Attachment #771485 -
Flags: review?(dbaron)
Attachment #773667 -
Flags: review?(Ms2ger)
Assignee | ||
Comment 21•11 years ago
|
||
testharness update changes some failure messages.
Attachment #773668 -
Flags: review?(Ms2ger)
Assignee | ||
Comment 22•11 years ago
|
||
Reverting testharnessreport.js changes because it is not needed anymore.
Attachment #773669 -
Flags: review?(dbaron)
Assignee | ||
Comment 23•11 years ago
|
||
Updated•11 years ago
|
Attachment #773669 -
Flags: review?(dbaron) → review+
Assignee | ||
Updated•11 years ago
|
OS: Windows 8 → All
Hardware: x86_64 → All
Summary: testharnessreport.js should deal with uncaught exceptions → testharness.js should deal with uncaught exceptions
Comment 25•11 years ago
|
||
Comment on attachment 773667 [details] [diff] [review]
Sync testharness with the latest upstream
Review of attachment 773667 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/imptests/updateTestharness.py
@@ +11,5 @@
> dest = "resources-upstream"
> +files = [{"f":"testharness.js"},
> + {"f":"testharness.css"},
> + {"f":"idlharness.js"},
> + {"d":"webidl2/lib/webidl2.js", "f":"WebIDLParser.js"}]
These names are not terribly useful... I guess I can fix that later.
Attachment #773667 -
Flags: review?(Ms2ger) → review+
Comment 26•11 years ago
|
||
Comment on attachment 773668 [details] [diff] [review]
Update known failures
Review of attachment 773668 [details] [diff] [review]:
-----------------------------------------------------------------
r=me if this passes
Attachment #773668 -
Flags: review?(Ms2ger) → review+
Updated•11 years ago
|
Flags: needinfo?(Ms2ger)
Assignee | ||
Comment 27•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e12c6f7d6676
https://hg.mozilla.org/integration/mozilla-inbound/rev/bf423f63b3a1
Flags: in-testsuite+
Comment 28•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e12c6f7d6676
https://hg.mozilla.org/mozilla-central/rev/bf423f63b3a1
Status: ASSIGNED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Comment 29•11 years ago
|
||
Backed out on suspicion of causing bug 894952:
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/c0ffa345ca78
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/c59a89e00478
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 30•11 years ago
|
||
Will bug 895578 help?
Assignee | ||
Comment 31•11 years ago
|
||
Or bug 887903. I suppose this patch just exposed the underlying problem more frequently.
Assignee | ||
Comment 32•11 years ago
|
||
Relanding only the test fix because it doesn't depend on the testharness update.
https://hg.mozilla.org/integration/mozilla-inbound/rev/bc10e63afa97
Whiteboard: [leave open]
Comment 33•11 years ago
|
||
Assignee | ||
Comment 34•11 years ago
|
||
Bug 895578 and bug 887903 are fixed, but this patch will make bug 900633 very frequent now.
https://tbpl.mozilla.org/?tree=Try&rev=200c053e82c9
We really need to fix the underlying issue...
Assignee | ||
Comment 35•11 years ago
|
||
I would not like to overlook exceptions thrown by testhaness tests until the OOM issue is resolved.
Attachment #785988 -
Flags: review?(dbaron)
Comment 36•11 years ago
|
||
Fixing bug 859087 should fix the OOM issues on this set of tests.
Comment 37•11 years ago
|
||
Comment on attachment 785988 [details] [diff] [review]
Add a global error handler to the testharness integration script
I guess this is ok for now, but maybe leave a comment that we can remove this when we upgrade to the new version of testharness.js?
You've tested that this causes mochitests to fail, right? (Both a TEST-UNEXPECTED-FAIL line and a failure of the test suite.)
Attachment #785988 -
Flags: review?(dbaron) → review+
Assignee | ||
Comment 38•11 years ago
|
||
Assignee | ||
Comment 39•11 years ago
|
||
(In reply to David Baron [:dbaron] (don't cc:, use needinfo? instead) from comment #37)
> I guess this is ok for now, but maybe leave a comment that we can remove
> this when we upgrade to the new version of testharness.js?
Landed with a comment.
> You've tested that this causes mochitests to fail, right? (Both a
> TEST-UNEXPECTED-FAIL line and a failure of the test suite.)
Yes, test update (already landed) was needed to fix errors caught by this patch.
Comment 40•11 years ago
|
||
Assignee | ||
Comment 41•11 years ago
|
||
Yet another proof we shouldn't ignore uncaught exceptions... :(
Assignee | ||
Comment 42•11 years ago
|
||
Bug 920064 change should be reverted once the new WebIDL2.js has been landed.
Assignee | ||
Comment 43•11 years ago
|
||
- Folded the test update.
- Rebased to tip.
- Reverted the comment out added in bug 920064.
Requires the bug 921298 patch first.
Try run: https://tbpl.mozilla.org/?tree=Try&rev=7b217f9ad22d
Attachment #773667 -
Attachment is obsolete: true
Attachment #773668 -
Attachment is obsolete: true
Attachment #785988 -
Attachment is obsolete: true
Attachment #811230 -
Flags: review?(Ms2ger)
Updated•11 years ago
|
Attachment #811230 -
Flags: feedback?(sheriffs)
Comment 44•11 years ago
|
||
What kind of feedback are you looking for?
Flags: in-testsuite+
Target Milestone: mozilla25 → ---
Assignee | ||
Comment 45•11 years ago
|
||
Confirming that the patch will not cause random orange again?
Comment 46•11 years ago
|
||
Comment on attachment 811230 [details] [diff] [review]
Sync testharness with the latest upstream
If Try is happy, I'm happy. We're not expecting any issues on other platforms I take it?
Attachment #811230 -
Flags: feedback?(sheriffs) → feedback+
Comment 47•11 years ago
|
||
Comment on attachment 811230 [details] [diff] [review]
Sync testharness with the latest upstream
Review of attachment 811230 [details] [diff] [review]:
-----------------------------------------------------------------
rs=me, assuming you checked that
/dom/imptests/html/dom/test_interfaces.html
/dom/imptests/editing/selecttest/test_interfaces.html
/dom/imptests/webapps/XMLHttpRequest/tests/submissions/Ms2ger/test_interfaces.html
all still run.
Attachment #811230 -
Flags: review?(Ms2ger) → review+
Assignee | ||
Comment 48•11 years ago
|
||
Status: REOPENED → ASSIGNED
Whiteboard: [leave open]
Comment 49•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago → 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in
before you can comment on or make changes to this bug.
Description
•