xpcshell-tests: pipe output through stack fixer script

RESOLVED FIXED in Firefox 41

Status

Testing
XPCShell Harness
--
enhancement
RESOLVED FIXED
9 years ago
3 years ago

People

(Reporter: Waldo, Assigned: chmanchester)

Tracking

Trunk
mozilla41
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox41 fixed)

Details

(Whiteboard: [ToDo: comment 9], URL)

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments, 1 obsolete attachment)

Better crash stacks would be nice, and they shouldn't be too hard to set up given runxpcshellmumblemumble.py.
Er, where would this be useful? We don't currently get crash stacks for xpcshell tests. (That's bug 483062)
Assertions generated via XPCOM_DEBUG_BREAK=stack-and-abort in debug builds, sorry, "crash stack" was a red herring.
Is this a duplicate of bug 483062, or an additional step to add?
Version: unspecified → Trunk
Additional step, since generating crash stacks currently requires special configuration, and developers running tests locally should be able to get stacks from assertions without having to do anything special.
(In reply to comment #4)

(I know little about this, so:)

> generating crash stacks currently requires special configuration,

What "special configuration" are you referring to?

> and developers running tests locally should be able to get
> stacks from assertions without having to do anything special.

Is this bug (still) 'xpcshell-tests' specific, or actually applies to all (3) test harnesses (which can generate (crash) stacks)?
Depends on: 483062
Summary: Pipe xpcshell test output through tools/rb/fix-*-stack.pl → xpcshell-tests: pipe output through tools/rb/fix-(linux|macosx)-stack.pl
Duplicate of this bug: 510550
See bug 385248, which did this for all the scripts that use automation.py.
Depends on: 385248
I guess comment 7 answers comment 5 :-)

The situation is:

reftest + mochitest:
call automation.runApp(), which calls fix-*-stack.pl and automationutils.checkForCrashes().

xpcshell-tests:
calls Popen(), then automationutils.checkForCrashes() directly.

Could runxpcshelltests.py be switched to call automation.runApp()?
Or do we need to port the enhancement to runxpcshelltests.py?
Please port the enhancements. |runApp()| is focused on running a browser, not xpcshell.
(I got answers and had a look, but I won't be doing this bug.)
Whiteboard: [ToDo: comment 9]

Comment 11

8 years ago
We could factor the stack-fixer-calling out of runApp (now waitForFinish) rather than copy-pasting it.  This would be easier if the stack fixers were all python, which might happen soon.
bsmedberg just hit this with a patch that made the xpcshell selftests assert. This should be fairly straightforward to fix nowadays that the scripts are Python.
Summary: xpcshell-tests: pipe output through tools/rb/fix-(linux|macosx)-stack.pl → xpcshell-tests: pipe output through stack fixer script
(Assignee)

Comment 13

3 years ago
I'll take this.
Assignee: nobody → cmanchester
(Assignee)

Comment 15

3 years ago
Created attachment 8598814 [details]
MozReview Request: bz://487494/chmanchester

/r/7777 - Bug 487494 - Pipe xpcshell's output through a stack fixer.;r=ted

Pull down this commit:

hg pull -r 0071c62f08a1ea75df02acbf7c06edf123457f85 https://reviewboard-hg.mozilla.org/gecko/
Attachment #8598814 - Flags: review?(ted)
https://reviewboard.mozilla.org/r/7777/#review7149

::: testing/xpcshell/runxpcshelltests.py:1537
(Diff revision 1)
> +        self.add_option("--utility-path",

You're going to need to change the mozharness invocation to specify this in order for this to work in automation, right?

::: testing/xpcshell/selftest.py:360
(Diff revision 1)
> +        self.utility_path = os.path.join(objdir, 'dist', 'bin')

I guess for bonus points we could write a unit test here, but I'll settle for filing a followup bug. The test itself could just do:
```
Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2).assertion("foo", "assertion failed", "test.js", 1);
```
(Assignee)

Comment 17

3 years ago
https://reviewboard.mozilla.org/r/7777/#review7199

> You're going to need to change the mozharness invocation to specify this in order for this to work in automation, right?

Should just be able to add it to the in-tree config.

> I guess for bonus points we could write a unit test here, but I'll settle for filing a followup bug. The test itself could just do:
> ```
> Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2).assertion("foo", "assertion failed", "test.js", 1);
> ```

Nice, I'll give it a shot.
(Assignee)

Comment 18

3 years ago
Comment on attachment 8598814 [details]
MozReview Request: bz://487494/chmanchester

/r/7777 - Bug 487494 - Add an xpcshell selftest for readable stacks from assertions.;r=ted
/r/8659 - Bug 487494 - Pipe xpcshell's output through a stack fixer.;r=ted

Pull down these commits:

hg pull -r e43477e822b9385528419867fa0ba07de1362556 https://reviewboard-hg.mozilla.org/gecko/
(Assignee)

Comment 19

3 years ago
Comment on attachment 8598814 [details]
MozReview Request: bz://487494/chmanchester
Attachment #8598814 - Attachment is obsolete: true
Attachment #8598814 - Flags: review?(ted)
Attachment #8617977 - Flags: review?(ted)
Attachment #8617978 - Flags: review?(ted)
(Assignee)

Comment 20

3 years ago
Created attachment 8617977 [details]
MozReview Request: Bug 487494 - Add an xpcshell selftest for readable stacks from assertions.;r=ted
(Assignee)

Comment 21

3 years ago
Created attachment 8617978 [details]
MozReview Request: Bug 487494 - Pipe xpcshell's output through a stack fixer.;r=ted
Comment on attachment 8617977 [details]
MozReview Request: Bug 487494 - Add an xpcshell selftest for readable stacks from assertions.;r=ted

https://reviewboard.mozilla.org/r/7777/#review9481

::: testing/xpcshell/selftest.py:359
(Diff revision 2)
> +'''

You could just put this inline in the test body since you're not using it for any other tests.
Attachment #8617977 - Flags: review?(ted)
Comment on attachment 8617977 [details]
MozReview Request: Bug 487494 - Add an xpcshell selftest for readable stacks from assertions.;r=ted

https://reviewboard.mozilla.org/r/7777/#review9483

Ship It!
Attachment #8617977 - Flags: review+
Comment on attachment 8617978 [details]
MozReview Request: Bug 487494 - Pipe xpcshell's output through a stack fixer.;r=ted

https://reviewboard.mozilla.org/r/8659/#review9485

Ship It!
Attachment #8617978 - Flags: review?(ted) → review+
https://hg.mozilla.org/mozilla-central/rev/182ac56399c4
https://hg.mozilla.org/mozilla-central/rev/98e985a2d950
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox41: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.