Closed Bug 1143091 Opened 9 years ago Closed 9 years ago

restarting tests with --keep-open is hard

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(firefox39 fixed)

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: froydnj, Assigned: jmaher)

Details

Attachments

(1 file)

I'm writing a new browser-chrome mochitest, and I got tired of waiting for the harness to start up every time.  I thought I would be clever and run:

  mach mochitest-browser --keep-open $TEST

and then click the "run $DIR tests" button in the browser window that pops open.

Turns out that doesn't work; I get:

TEST-UNEXPECTED-FAIL: setup.js | error parsing http://mochi.test:8888/tests.json (TypeError: redeclaration of const KEYBOARD_LAYOUT_ARABIC)
JavaScript error: chrome://mochikit/content/tests/SimpleTest/EventUtils.js, line 646: TypeError: redeclaration of const KEYBOARD_LAYOUT_ARABIC

when clicking the button.

I can fix all of the |const| issues in EventUtils.js, but I'm wondering if a) the above was the wrong way to do things; or b) if there's a better way to fix things so that they work as expected?  (c, making this testable so it doesn't regress, would be even better!)
Flags: needinfo?(jmaher)
We should support this use case, though it risks frequently running into "tests don't clean up fully" or "tests depend on a clean application slate" issues.

To do this cleanly we probably want to update runTests() in browser-harness.xul to be smarter about its second invocation - e.g. it should not re-generate the test list. Maybe that's as easy as just having it cache the Tester() object it creates via createTester() rather than always re-creating one.
Assignee: nobody → jmaher
Status: NEW → ASSIGNED
Flags: needinfo?(jmaher)
Attachment #8578765 - Flags: review?(ted)
Attachment #8578765 - Flags: review?(ted) → review+
https://hg.mozilla.org/mozilla-central/rev/e61d6f1841dc
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Component: BrowserTest → Mochitest
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: