Closed Bug 610046 Opened 15 years ago Closed 15 years ago

Let jsreftests that should silently fail do so

Categories

(Testing :: Reftest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla2.0b10

People

(Reporter: azakai, Assigned: azakai)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(2 files, 1 obsolete file)

See https://bugzilla.mozilla.org/show_bug.cgi?id=502836#c19 A serious error is encountered, the script is silently halted, but the test harness gets no indication of anything, so it thinks the script finished normally (in the case above, without running necessary code at the end of the script, so the test fails). The intended behavior, as explained by igor, is that the error should not be fatal - the browser should not quit - but the script should be halted, in hopes of recovering memory from that. So that is ok; all that is wrong is that the error is not detected by the test harness. So, such errors should be 'caught' by the test harness, so that expectExitCode will work.
Blocks: 502836
Requesting blocking as this is needed for bug 502836 (which is blocking).
blocking2.0: --- → ?
Assignee: general → azakai
Summary: Tests with expectExitCode do not work in the browser → Let jsreftests that should silently fail do so
Component: JavaScript Engine → Layout
QA Contact: general → layout
Attached patch patch (obsolete) — Splinter Review
Patch allows reftests (and in particular jsreftests) to be explicitly marked as allowing silent failure (with |silentfail|). On such a test, if no test results were reported, we mark it as having passed. This allows enabling a few jsreftests that were disabled before, 336409-2, 336410-1, 336410-2, all of which had issues when running in the browser, due to triggering out of memory situations (on certain build types), which are purposefully silently failed on (in the browser; the js shell will terminate itself). It also allows the patch to blocker bug 502836 to be pushed (after which we can run into out of memory situations in some jsreftests as well, because we allow more system memory to be used, so when we run out of memory can change). P.S. I'm not sure whether this patch needs blocking status in order to be pushed, as it's just changes to test code? (I presume reftest.js is only run when running reftests?)
Attachment #489283 - Flags: review?(roc)
Component: Layout → Reftest
Product: Core → Testing
QA Contact: layout → reftest
Comment on attachment 489283 [details] [diff] [review] patch Please add documentation of the new keyword to layout/tools/reftest/README.txt > } else if ((m = item.match(/^slow-if\((.*?)\)$/))) { > cond = false; > if (Components.utils.evalInSandbox("(" + m[1] + ")", sandbox)) > slow = true; >+ } else if (item == "silentfail") { >+ allow_silent_fail = true; > } else { > throw "Error 1 in manifest file " + aURL.spec + " line " + lineNo; > } Two issues here: 1) you should also add support for silentfail-if, to match the pattern of the other keywords. 2) you should set cond = false; otherwise you'll reuse cond from the previous iteration of the loop, which could be wrong Other than that, this looks fine, but :bc: should also review this (in addition to me).
Attachment #489283 - Flags: review?(roc) → review-
> else if (testcases.length == 0) { > // This failure may be due to a JavaScript Engine bug causing >- // early termination of the test. >- missing_msg = "No test results reported. (SCRIPT)\n"; >+ // early termination of the test. If we do not allow silent >+ // failure, report an error. >+ if (!gURLs[0].allowSilentFail) >+ missing_msg = "No test results reported. (SCRIPT)\n"; Do we want to output an INFO type message if the error is suppressed due to allowSilentFail?
Attached patch patch v2Splinter Review
Ok, here's a patch that fixes the issues that were mentioned.
Attachment #489283 - Attachment is obsolete: true
Attachment #489369 - Flags: review?(dbaron)
Attachment #489369 - Flags: review?(bclary)
Comment on attachment 489369 [details] [diff] [review] patch v2 Looks good, though you could actually also handle silentfail by just adding to the regex in: } else if (item.match(/^(fails|random|skip)$/)) { stat = item; cond = true; instead of adding: + } else if (item == "silentfail") { + cond = false; + allow_silent_fail = true; (And we could probably handle slow the same way; that would have been cleaner. But that's another patch...) Also, the documentation in README.txt should mention that this is only for script tests. r=dbaron with that.
Attachment #489369 - Flags: review?(dbaron) → review+
Attachment #489369 - Flags: review?(bclary) → review+
Attached patch patch v3Splinter Review
I was overly optimistic in enabling those old tests - they fail intermittently. So, I re-disabled them, in this patch the only change to tests is to add |silentfail| where necessary, nothing else.
Comment on attachment 491217 [details] [diff] [review] patch v3 Not sure if this change (re-enabling the old tests that the previous patch enabled) needs a review or not?
Attachment #491217 - Flags: review?(bclary)
Attachment #491217 - Flags: review?(bclary) → review+
Whiteboard: fixed-in-tracemonkey
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
This changeset adds the following warnings in the js shell tests: warning: invalid manifest line element "silentfail" warning: invalid manifest line element "silentfail" warning: invalid manifest line element "silentfail" Are they benign?
Hmm, we only really need the ability to ignore silent fails in the browser, so these are fairly harmless, but maybe we should clean them up anyhow. Which option is better? 1) Handle silent failure in shell tests (even though we don't need it, but for consistency) 2) Ignore 'silentfail' so that warning is not shown.
What would 1) entail?
I would guess something similar to what the browser ones have - if there is no log output about tests passing (which can happen if a test silently halts, in the browser), then consider that ok if |silentfail| was set. But we'd need to figure out whether such silent failures are even possible in the shell and how they behave.
I would guess we should make it the same as 'skip'. I don't see the benefit of running the test to ignore it's failure. I don't fully understand why the browser does it, but I think those reasons don't apply when testing in the shell?
One benefit is that we still test that the test doesn't crash.
I'd go with that, except that these tests use tons of memory, and might be better skipped anyway?
blocking2.0: ? → ---
I took care of my follow-up comments (js shell changes) in bug 620850.
Target Milestone: --- → mozilla2.0b10
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: