Closed Bug 873204 Opened 11 years ago Closed 10 years ago

Jetpack tests need to log crash stacks

Categories

(Add-on SDK Graveyard :: General, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bholley, Unassigned)

References

(Blocks 1 open bug)

Details

Right now they don't, which a major pain for developers when they cause a crash that appears only in jetpack tests. Ted says this should be straightforward to do now, and Mossop sounds like he's down to find an owner.
Looks like something along these lines should do it: http://mxr.mozilla.org/mozilla-central/source/build/automation.py.in#1136. Looks simple enough...
Flags: needinfo?(dtownsend+bugmail)
What do the Jetpack tests actually run? Firefox? xpcshell? If the former then it's as simple as setting a few environment variables:
http://mxr.mozilla.org/mozilla-central/source/build/automation.py.in#744

and then looking in $profile/minidumps like you said in comment 1.
Depends on: 873691
Depends on: 873693
So, this is harder that it might first appear. There are three challenges:

The easy part is making the jetpack test harness set the right environment variables and call the check_for_crashes code from mozcrash.

The harder part is making mozcrash available to the jetpack test harness: bug 873691

The probably hardest part is updating the buildbot steps to download the crash symbols and pass them on to the jetpack test harness: bug 873693
Flags: needinfo?(dtownsend+bugmail)
Priority: -- → P2
Product: Testing → Add-on SDK
Blocks: 913027
Blocks: 1020473
Blocks: 778688
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #2)
> What do the Jetpack tests actually run? Firefox? xpcshell? If the former
> then it's as simple as setting a few environment variables:
> http://mxr.mozilla.org/mozilla-central/source/build/automation.py.in#744
> 
> and then looking in $profile/minidumps like you said in comment 1.

So far as I know, after the mochitestification (bug 1035512) of the jetpack tests
these environment variables will be set properly when running the mochitest-jetpack suite, which will
be triggered by pushes to trees like fx-team, but the https://tbpl.mozilla.org/?tree=Jetpack tree will still use cfx and need these environment variables set for better reports.

Which environment variables should we be adding when running tests here?

 * MOZ_CRASHREPORTER = 1 (if not using a debug build)
 * MOZ_CRASHREPORTER_NO_REPORT = 1 (if not using a debug build)
 * MOZ_CRASHREPORTER_DISABLE = 1 (if using a debug build)
 * GNOME_DISABLE_CRASH_DIALOG = 1
 * XRE_NO_WINDOWS_CRASH_DIALOG = 1
 * NO_EM_RESTART = 1

Also I ask because it looks as though we should use some of these in JPM https://github.com/mozilla/jpm

Note: we have these already https://github.com/mozilla/gecko-dev/blob/5f114a410d7ace55915839b149947c1e619b36cf/addon-sdk/source/python-lib/cuddlefish/runner.py#L514-L520
Flags: needinfo?(ted)
Unfortunately I don't think the environment variables are all we need, there is also the code in mozcrash which processes the dump files to output the stacks. Using the mochitest stuff in the Jetpack tree is a possibility though.
http://hg.mozilla.org/mozilla-central/annotate/a084c4cfd8a1/build/automation.py.in#l505

There are a lot of other variables there, most of them are just to suppress other crash dialogs etc, they're not necessary for our crash reporting to function properly.

After the app exits you can use mozcrash.check_for_crashes:
http://hg.mozilla.org/mozilla-central/annotate/a084c4cfd8a1/build/automation.py.in#l807
Flags: needinfo?(ted)
Fixed by bug 1035512
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.