Open Bug 1728397 Opened 3 years ago Updated 3 years ago

Refreshing a page running a mochitest using add_task results in SimpleTest harness error

Categories

(Testing :: Mochitest, defect, P3)

Default
defect

Tracking

(Not tracked)

People

(Reporter: bryce, Unassigned)

Details

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.

The above failure state is fission specific in my testing. For non-fission runs (./mach mochitest dom/media/test/test_background_video_suspend_ready_state.htm) my tests do rerun on refresh, though I get different errors logged to my console:

 0:49.77 GECKO(23720) [Parent 29800, Main Thread] WARNING: '!mContentCache.HandleQueryContentEvent( aEvent, textInputHandlingWidget)', file c:/projects/mozilla/mozilla-unified/dom/ipc/BrowserParent.cpp:3046
 0:50.00 GECKO(23720) [Child 11900, Main Thread] ###!!! ASSERTION: Adding a child where we already have a child? This may misbehave: 'aUseRemoteSubframes', file c:/projects/mozilla/mozilla-unified/docshell/shistory/nsSHEntry.cpp:672
 0:50.00 GECKO(23720) #01: NS_DebugBreak (c:\projects\mozilla\mozilla-unified\xpcom\base\nsDebugImpl.cpp:431)
 0:50.00 GECKO(23720) #02: nsSHEntry::AddChild (c:\projects\mozilla\mozilla-unified\docshell\shistory\nsSHEntry.cpp:673)
 0:50.00 GECKO(23720) #03: nsDocShell::AddChildSHEntryToParent (c:\projects\mozilla\mozilla-unified\docshell\base\nsDocShell.cpp:2978)
 0:50.01 GECKO(23720) #04: nsDocShell::AddToSessionHistory (c:\projects\mozilla\mozilla-unified\docshell\base\nsDocShell.cpp:11630)
 0:50.01 GECKO(23720) #05: nsDocShell::OnNewURI (c:\projects\mozilla\mozilla-unified\docshell\base\nsDocShell.cpp:10835)
 0:50.01 GECKO(23720) #06: nsDocShell::CreateContentViewer (c:\projects\mozilla\mozilla-unified\docshell\base\nsDocShell.cpp:7768)
 0:50.01 GECKO(23720) #07: nsDSURIContentListener::DoContent (c:\projects\mozilla\mozilla-unified\docshell\base\nsDSURIContentListener.cpp:179)
 0:50.01 GECKO(23720) #08: nsDocumentOpenInfo::TryContentListener (c:\projects\mozilla\mozilla-unified\uriloader\base\nsURILoader.cpp:596)
 0:50.01 GECKO(23720) #09: nsDocumentOpenInfo::DispatchContent (c:\projects\mozilla\mozilla-unified\uriloader\base\nsURILoader.cpp:276)
 0:50.01 GECKO(23720) #10: nsDocumentOpenInfo::OnStartRequest (c:\projects\mozilla\mozilla-unified\uriloader\base\nsURILoader.cpp:154)
 0:50.01 GECKO(23720) #11: nsBaseChannel::OnStartRequest (c:\projects\mozilla\mozilla-unified\netwerk\base\nsBaseChannel.cpp:821)
 0:50.01 GECKO(23720) #12: nsInputStreamPump::OnStateStart (c:\projects\mozilla\mozilla-unified\netwerk\base\nsInputStreamPump.cpp:465)
 0:50.01 GECKO(23720) #13: nsInputStreamPump::OnInputStreamReady (c:\projects\mozilla\mozilla-unified\netwerk\base\nsInputStreamPump.cpp:374)
 0:50.01 GECKO(23720) #14: mozilla::NonBlockingAsyncInputStream::RunAsyncWaitCallback (c:\projects\mozilla\mozilla-unified\xpcom\io\NonBlockingAsyncInputStream.cpp:398)
 0:50.01 GECKO(23720) #15: mozilla::NonBlockingAsyncInputStream::AsyncWaitRunnable::Run (c:\projects\mozilla\mozilla-unified\xpcom\io\NonBlockingAsyncInputStream.cpp:33)
 0:50.01 GECKO(23720) #16: mozilla::SchedulerGroup::Runnable::Run (c:\projects\mozilla\mozilla-unified\xpcom\threads\SchedulerGroup.cpp:144)
 0:50.02 GECKO(23720) #17: mozilla::RunnableTask::Run (c:\projects\mozilla\mozilla-unified\xpcom\threads\TaskController.cpp:503)
 0:50.02 GECKO(23720) #18: mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal (c:\projects\mozilla\mozilla-unified\xpcom\threads\TaskController.cpp:805)
 0:50.02 GECKO(23720) #19: mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal (c:\projects\mozilla\mozilla-unified\xpcom\threads\TaskController.cpp:641)
 0:50.02 GECKO(23720) #20: mozilla::TaskController::ProcessPendingMTTask (c:\projects\mozilla\mozilla-unified\xpcom\threads\TaskController.cpp:425)
 0:50.02 GECKO(23720) #21: mozilla::detail::RunnableFunction<`lambda at c:/projects/mozilla/mozilla-unified/xpcom/threads/TaskController.cpp:135:7'>::Run (c:\projects\mozilla\mozilla-unified\xpcom\threads\nsThreadUtils.h:533)
 0:50.02 GECKO(23720) #22: nsThread::ProcessNextEvent (c:\projects\mozilla\mozilla-unified\xpcom\threads\nsThread.cpp:1152)
 0:50.02 GECKO(23720) #23: NS_ProcessNextEvent (c:\projects\mozilla\mozilla-unified\xpcom\threads\nsThreadUtils.cpp:466)
 0:50.02 GECKO(23720) #24: mozilla::ipc::MessagePump::Run (c:\projects\mozilla\mozilla-unified\ipc\glue\MessagePump.cpp:85)
 0:50.02 GECKO(23720) #25: MessageLoop::RunHandler (c:\projects\mozilla\mozilla-unified\ipc\chromium\src\base\message_loop.cc:325)
 0:50.02 GECKO(23720) #26: MessageLoop::Run (c:\projects\mozilla\mozilla-unified\ipc\chromium\src\base\message_loop.cc:307)
 0:50.02 GECKO(23720) #27: nsBaseAppShell::Run (c:\projects\mozilla\mozilla-unified\widget\nsBaseAppShell.cpp:139)
 0:50.02 GECKO(23720) #28: nsAppShell::Run (c:\projects\mozilla\mozilla-unified\widget\windows\nsAppShell.cpp:603)
 0:50.02 GECKO(23720) #29: XRE_RunAppShell (c:\projects\mozilla\mozilla-unified\toolkit\xre\nsEmbedFunctions.cpp:917)
 0:50.03 GECKO(23720) #30: mozilla::ipc::MessagePumpForChildProcess::Run (c:\projects\mozilla\mozilla-unified\ipc\glue\MessagePump.cpp:235)
 0:50.03 GECKO(23720) #31: MessageLoop::RunHandler (c:\projects\mozilla\mozilla-unified\ipc\chromium\src\base\message_loop.cc:325)
 0:50.03 GECKO(23720) #32: MessageLoop::Run (c:\projects\mozilla\mozilla-unified\ipc\chromium\src\base\message_loop.cc:307)
 0:50.03 GECKO(23720) #33: XRE_InitChildProcess (c:\projects\mozilla\mozilla-unified\toolkit\xre\nsEmbedFunctions.cpp:753)
 0:50.03 GECKO(23720) #34: NS_internal_main (c:\projects\mozilla\mozilla-unified\browser\app\nsBrowserApp.cpp:327)
 0:50.03 GECKO(23720) #35: wmain (c:\projects\mozilla\mozilla-unified\toolkit\xre\nsWindowsWMain.cpp:131)
 0:50.03 GECKO(23720) #36: __scrt_common_main_seh (d:\a01\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
 0:50.03 GECKO(23720) #37: BaseThreadInitThunk [C:\WINDOWS\System32\KERNEL32.DLL + 0x17034]
 0:50.03 GECKO(23720) #38: RtlUserThreadStart [C:\WINDOWS\SYSTEM32\ntdll.dll + 0x52651]

Not sure if related, but copying here in case it's of use.

Severity: -- → S4
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.