Bug 1728397 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I'll sometimes refresh the browser window a mochitest is running in to rerun the test as part of debugging. This appears to cause issues if the test uses `add_task`.

STR:
- Run a mochitest that uses `add_task` to schedule tasks. E.g. `./mach mochitest dom/media/test/test_background_video_suspend_ready_state.html --enable-fission`
- Once the test has finished refresh the page.

Actual results:
The test fails to rerun, though it will rerun after several refreshes. The failure results in the following error being logged

```
Unexpected Results
------------------
unknown test url
  FAIL uncaught exception - TypeError: can't access property "testRoot", SimpleTest.harnessParameters is undefined at SimpleTest_setTimeoutShim@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:881:13
add_task@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:2050:17
@http://mochi.test:8888/tests/dom/media/test/test_background_video_suspend_ready_state.html:16:9

    simpletestOnerror@SimpleTest/SimpleTest.js:1957:18

  FAIL /tests/dom/media/test/test_background_video_suspend_ready_state.html - finished in a non-clean fashion, probably because it didn't call SimpleTest.finish()
{'loaded_test_url': '/tests/dom/media/test/test_background_video_suspend_ready_state.html'}

Expected results:
The test reruns without the harness getting unhappy.
```
I'll sometimes refresh the browser window a mochitest is running in to rerun the test as part of debugging. This appears to cause issues if the test uses `add_task`.

STR:
- Run a mochitest that uses `add_task` to schedule tasks. E.g. `./mach mochitest dom/media/test/test_background_video_suspend_ready_state.html --enable-fission`
- Once the test has finished refresh the page.

Actual results:
The test fails to rerun, though it will rerun after several refreshes. The failure results in the following error being logged

```
Unexpected Results
------------------
unknown test url
  FAIL uncaught exception - TypeError: can't access property "testRoot", SimpleTest.harnessParameters is undefined at SimpleTest_setTimeoutShim@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:881:13
add_task@http://mochi.test:8888/tests/SimpleTest/SimpleTest.js:2050:17
@http://mochi.test:8888/tests/dom/media/test/test_background_video_suspend_ready_state.html:16:9

    simpletestOnerror@SimpleTest/SimpleTest.js:1957:18

  FAIL /tests/dom/media/test/test_background_video_suspend_ready_state.html - finished in a non-clean fashion, probably because it didn't call SimpleTest.finish()
{'loaded_test_url': '/tests/dom/media/test/test_background_video_suspend_ready_state.html'}
```

Expected results:
The test reruns without the harness getting unhappy.

Back to Bug 1728397 Comment 0