Open Bug 1425341 Opened 7 years ago Updated 2 years ago

Fail xpcshell tests in case of unexpected TypeError, ReferenceError, SyntaxError

Categories

(Testing :: XPCShell Harness, defect, P3)

Version 3
defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: Yoric, Assigned: ahal)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This will require some whitelisting. See https://treeherder-manifest.herokuapp.com/?repo=try&revision=7019110dfefb1650815bed25b2f1603ca6906ce5 for the results of an experiment: on Linux x64, I see 166 oranges.
Priority: -- → P3

This patch ensures that if we have raised a TypeError, SyntaxError or RangeError, we fail the test, even if the error was accidentally caught. This behavior can be deactivated manually as follows:

  • either by manually calling ChromeUtils.clearRecentJSDevError() after having thrown the error (recommended if the test expected the error to be thrown);
  • or by calling PromiseUtils.thisTestLeaksUncaughtRejectionsAndShouldBeFixed() to postpone fixing the issue.

Depends on D94989

Assignee: nobody → dteller
Status: NEW → ASSIGNED

ahal, you're now in charge!

Assignee: D.O.Teller+bugspam → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(ahal)

Here's a try push with the patch here and in the other bug landed:
https://treeherder.mozilla.org/jobs?repo=try&revision=5001964eda3c8713c4c63ca63741049f71904813

I'll make sure this is at least on our roadmap and try to come up with a plan to keep it moving forward.

Flags: needinfo?(ahal)

(In reply to Andrew Halberstadt [:ahal] from comment #3)

Here's a try push with the patch here and in the other bug landed:
https://treeherder.mozilla.org/jobs?repo=try&revision=5001964eda3c8713c4c63ca63741049f71904813

I'll make sure this is at least on our roadmap and try to come up with a plan to keep it moving forward.

Almost all of the errors seem to be "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data", maybe we should ignore that specific error message?

I was hoping we could set up a key in the manifests to disable this feature per-test. Possibly also per issue per test, but maybe start with just disabling it outright at the test level. Of course I'm not sure when anyone will have time to work on that, so I'm sympathetic to something quick and dirty in the short term.

Severity: normal → S3

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:Yoric, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(ahal)
Flags: needinfo?(D.O.Teller+bugspam)

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit auto_nag documentation.

Flags: needinfo?(D.O.Teller+bugspam)

This is something that we probably still want, but we can't land it until tests have all been updated or we come up with some sort of exception list system. It's likely also bitrotted by now.

Flags: needinfo?(ahal)
Assignee: nobody → ahal
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: