Closed Bug 1286697 Opened 4 years ago Closed 4 years ago

Android 'mach mochitest' times out at start of subsuite

Categories

(Firefox for Android :: Testing, defect, P1)

49 Branch
defect

Tracking

()

RESOLVED FIXED
Firefox 50
Tracking Status
firefox50 --- fixed

People

(Reporter: gbrown, Assigned: gbrown)

Details

Attachments

(1 file)

For example, 'mach mochitest testing/mochitest/tests/Harness_sanity', when it runs clipboard tests, starts the servers, starts the browser, and then times out waiting for something to happen. (All is well if run with '--subsuite default'.)

This seems to happen whenever running a set of tests that includes a subsuite: The main, non-subsuite tests run fine, then the harness tries to run the first subsuite, the browser is started, but no tests run.
It turns out SimpleTest/setup.js throws, so the harness is not properly initialized. The exception is caused by a bad log file name. The bad log file name comes from the logFile= parameter in the url -- it is specified twice. In fact, careful examination of the url options shows that all of the options are specified twice for the second run (the first subsuite).

Mochitest's urlOpts variable is not initialized between runs, so buildURLOptions() keeps appending the same options in addition to the old ones.

Desktop 'mach mochitest' does not have this problem because --run-by-dir is used so initializeLooping() is called, and that resets urlOpts appropriately.
Simply moving where urlOpts is initialized does a world of good: This way, each time mach creates a new mochitest object, urlOpts is fresh and ready to be appended to.

This solves my problems with 'mach mochitest' on Android and does not seem to break 'mach mochitest' on desktop. All's well on try too:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=82bf0e9c29cb
Attachment #8770773 - Flags: review?(jmaher)
Attachment #8770773 - Flags: review?(jmaher) → review+
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3b81d91e78c7
Initialize mochitest urlOpts to avoid duplicate options on subsequent runs; r=jmaher
https://hg.mozilla.org/mozilla-central/rev/3b81d91e78c7
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
You need to log in before you can comment on or make changes to this bug.