Bug: Intermittent browser/components/sessionstore/test/marionette/test_restore_windows_after_restart_and_quit.py TestSessionStoreDisabled.test_no_restore_with_quit | marionette_driver.errors.InvalidSessionIdException: Please start a session
Status: RESOLVED
Priority: P5
Resolution: INCOMPLETE
Created: 2023-01-19 03:34:42+00:00
Resolved: 2023-02-14 17:00:25+00:00

**Filed by:** sstanca [at] mozilla.com
**Parsed log:** https://treeherder.mozilla.org/logviewer?job_id=402824444&repo=autoland
**Full log:** https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/ER8MY92SSW-XdXUf0bOVhA/runs/0/artifacts/public/logs/live_backing.log

---
```
[task 2023-01-19T03:14:06.107Z] 03:14:06     INFO -  TEST-START | browser/components/sessionstore/test/marionette/test_restore_windows_after_restart_and_quit.py TestSessionStoreDisabled.test_no_restore_with_quit
[task 2023-01-19T03:14:06.213Z] 03:14:06     INFO -  Application command: Z:\task_167408882500176\build\application\firefox\firefox.exe -no-remote -marionette --wait-for-browser -profile C:\Users\task_167408882500176\AppData\Local\Temp\tmp89puae7w.mozrunner
[task 2023-01-19T03:14:06.401Z] 03:14:06     INFO -  DEBUG: Adding blocker AddonManager: shutting down. for phase profile-before-change
[task 2023-01-19T03:14:06.414Z] 03:14:06     INFO -  DEBUG: Adding blocker IOUtils Blocker (profile-before-change) for phase profile-before-change
[task 2023-01-19T03:14:06.421Z] 03:14:06     INFO -  DEBUG: Adding blocker IOUtils Blocker (profile-before-change-telemetry) for phase profile-before-change-telemetry
[task 2023-01-19T03:14:06.422Z] 03:14:06     INFO -  DEBUG: Adding blocker IOUtils Blocker (profile-before-change) for phase IOUtils: waiting for sendTelemetry IO to complete
[task 2023-01-19T03:14:06.422Z] 03:14:06     INFO -  DEBUG: Adding blocker IOUtils Blocker (xpcom-will-shutdown) for phase xpcom-will-shutdown
[task 2023-01-19T03:14:06.423Z] 03:14:06     INFO -  DEBUG: Adding blocker IOUtils Blocker (profile-before-change-telemetry) for phase IOUtils: waiting for xpcomWillShutdown IO to complete
[task 2023-01-19T03:14:06.449Z] 03:14:06     INFO -  DEBUG: Adding blocker Flush WebExtension StartupCache for phase IOUtils: waiting for profileBeforeChange IO to complete
[task 2023-01-19T03:14:06.546Z] 03:14:06     INFO -  DEBUG: Adding blocker JSON store: writing data for 'addonStartup' for phase AddonManager: Waiting for providers to shut down.
[task 2023-01-19T03:14:06.550Z] 03:14:06     INFO -  DEBUG: Adding blocker Update add-on blocklist state into add-on DB for phase AddonManager: Waiting to start provider shutdown.
[task 2023-01-19T03:14:06.553Z] 03:14:06     INFO -  DEBUG: Adding blocker XPIProvider shutdown for phase quit-application-granted
[task 2023-01-19T03:14:06.554Z] 03:14:06     INFO -  DEBUG: Adding blocker XPIProvider for phase AddonManager: Waiting for providers to shut down.
[task 2023-01-19T03:14:06.555Z] 03:14:06     INFO -  DEBUG: Adding blocker ServiceWorkerRegistrar: Flushing data for phase profile-before-change
[task 2023-01-19T03:14:06.557Z] 03:14:06     INFO -  DEBUG: Adding blocker CrashMonitor: Writing notifications to file after receiving profile-before-change and awaiting all checkpoints written for phase IOUtils: waiting for profileBeforeChange IO to complete
[task 2023-01-19T03:14:06.568Z] 03:14:06     INFO -  DEBUG: Adding blocker TelemetryController: shutting down for phase profile-before-change-telemetry
[task 2023-01-19T03:14:06.606Z] 03:14:06     INFO -  DEBUG: Adding blocker EnvironmentAddonBuilder for phase AddonManager: Waiting to start provider shutdown.
[task 2023-01-19T03:14:06.614Z] 03:14:06     INFO -  DEBUG: Adding blocker RemoteSettingsClient - finish IDB access. for phase profile-before-change
[task 2023-01-19T03:14:06.617Z] 03:14:06     INFO -  DEBUG: Adding blocker TerminatoryTelemetry: Waiting to submit telemetry for phase IOUtils: waiting for sendTelemetry IO to complete
[task 2023-01-19T03:14:06.619Z] 03:14:06     INFO -  1674098046619	Marionette	INFO	Marionette enabled
[task 2023-01-19T03:14:06.621Z] 03:14:06     INFO -  1674098046620	Marionette	TRACE	Received observer notification final-ui-startup
[task 2023-01-19T03:14:06.622Z] 03:14:06     INFO -  1674098046622	Marionette	INFO	Listening on port 2828
[task 2023-01-19T03:14:06.622Z] 03:14:06     INFO -  1674098046622	Marionette	DEBUG	Marionette is listening
[task 2023-01-19T03:14:06.665Z] 03:14:06     INFO -  DEBUG: Adding blocker AboutHomeStartupCache: Writing cache for phase quit-application-granted
[task 2023-01-19T03:14:06.678Z] 03:14:06     INFO -  DEBUG: Adding blocker PermissionManager: Flushing data for phase xpcom-will-shutdown
[task 2023-01-19T03:14:06.729Z] 03:14:06     INFO -  DEBUG: Completed blocker Update add-on blocklist state into add-on DB for phase AddonManager: Waiting to start provider shutdown.
[task 2023-01-19T03:14:06.746Z] 03:14:06     INFO -  DEBUG: Adding blocker ClientManagerService: start destroying IPC actors early for phase xpcom-will-shutdown
[task 2023-01-19T03:14:06.755Z] 03:14:06     INFO -  1674098046755	Marionette	DEBUG	Accepted connection 0 from 127.0.0.1:51990
[task 2023-01-19T03:14:06.758Z] 03:14:06     INFO -  1674098046758	Marionette	DEBUG	Closed connection 0
[task 2023-01-19T03:14:06.895Z] 03:14:06     INFO -  DEBUG: Adding blocker MediaShutdownManager: shutdown for phase profile-before-change
[task 2023-01-19T03:14:06.914Z] 03:14:06     INFO -  1674098046926	Marionette	DEBUG	Accepted connection 1 from 127.0.0.1:51993
[task 2023-01-19T03:14:06.944Z] 03:14:06     INFO -  1674098046952	Marionette	DEBUG	Closed connection 1
[task 2023-01-19T03:14:06.953Z] 03:14:06     INFO -  1674098046952	Marionette	DEBUG	Accepted connection 2 from 127.0.0.1:51994
[task 2023-01-19T03:14:06.980Z] 03:14:06     INFO -  1674098046980	Marionette	DEBUG	2 -> [0,1,"WebDriver:NewSession",{"strictFileInteractability":true}]
[task 2023-01-19T03:14:06.984Z] 03:14:06     INFO -  1674098046984	Marionette	DEBUG	Waiting for initial application window
[task 2023-01-19T03:14:06.991Z] 03:14:06     INFO -  DEBUG: Adding blocker ServiceWorkerShutdownBlocker: shutting down Service Workers for phase profile-change-teardown
<...>
[task 2023-01-19T03:14:12.868Z] 03:14:12     INFO -  DEBUG: Adding blocker ContentParent: id=268b219b100 for phase quit-application-granted
[task 2023-01-19T03:14:12.868Z] 03:14:12     INFO -  1674098052867	Marionette	TRACE	Received observer notification browser-idle-startup-tasks-finished
[task 2023-01-19T03:14:12.869Z] 03:14:12     INFO -  DEBUG: Adding blocker ScriptPreloader: Saving bytecode cache for phase xpcom-will-shutdown
[task 2023-01-19T03:14:12.871Z] 03:14:12     INFO -  1674098052871	RemoteAgent	TRACE	[3] ProgressListener Start: expectNavigation=false resolveWhenStarted=false unloadTimeout=200 waitForExplicitStart=false
[task 2023-01-19T03:14:12.871Z] 03:14:12     INFO -  1674098052871	RemoteAgent	TRACE	[3] ProgressListener Setting unload timer (200ms)
[task 2023-01-19T03:14:12.871Z] 03:14:12     INFO -  1674098052871	RemoteAgent	TRACE	[3] Document already finished loading: about:home
[task 2023-01-19T03:14:12.872Z] 03:14:12     INFO -  1674098052871	RemoteAgent	TRACE	[3] ProgressListener Stop: has error=false
[task 2023-01-19T03:14:12.879Z] 03:14:12     INFO -  1674098052878	Marionette	DEBUG	2 <- [1,1,null,{"sessionId":"2d5b2bf5-ebdf-4b67-b4b4-987d00750d58","capabilities":{"browserName":"firefox","browserVersion":"111.0a1","platformName":"windows","acceptInsecureCerts":false,"pageLoadStrategy":"normal","setWindowRect":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"strictFileInteractability":true,"unhandledPromptBehavior":"dismiss and notify","moz:accessibilityChecks":false,"moz:buildID":"20230119014822","moz:headless":false,"moz:platformVersion":"10.0","moz:processID":5172,"moz:profile":"C:\\Users\\task_167408882500176\\AppData\\Local\\Temp\\tmp89puae7w.mozrunner","moz:shutdownTimeout":60000,"moz:useNonSpecCompliantPointerOrigin":false,"moz:webdriverClick":true,"moz:windowless":false,"proxy":{}}}]
[task 2023-01-19T03:14:12.884Z] 03:14:12     INFO -  1674098052884	Marionette	DEBUG	2 -> [0,2,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-01-19T03:14:12.884Z] 03:14:12     INFO -  1674098052884	Marionette	DEBUG	2 <- [1,2,null,{"value":null}]
[task 2023-01-19T03:14:12.885Z] 03:14:12     INFO -  1674098052885	Marionette	DEBUG	2 -> [0,3,"Marionette:GetContext",{}]
[task 2023-01-19T03:14:12.885Z] 03:14:12     INFO -  1674098052885	Marionette	DEBUG	2 <- [1,3,null,{"value":"chrome"}]
[task 2023-01-19T03:14:12.886Z] 03:14:12     INFO -  1674098052886	Marionette	DEBUG	2 -> [0,4,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-01-19T03:14:12.886Z] 03:14:12     INFO -  1674098052886	Marionette	DEBUG	2 <- [1,4,null,{"value":null}]
[task 2023-01-19T03:14:12.887Z] 03:14:12     INFO -  1674098052887	Marionette	DEBUG	2 -> [0,5,"WebDriver:GetWindowHandles",{}]
[task 2023-01-19T03:14:12.888Z] 03:14:12     INFO -  1674098052887	Marionette	DEBUG	2 <- [1,5,null,["be161d4e-b5c0-4b3b-9552-2ccfb6d187bc"]]
[task 2023-01-19T03:14:12.889Z] 03:14:12     INFO -  1674098052888	Marionette	DEBUG	2 -> [0,6,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-01-19T03:14:12.889Z] 03:14:12     INFO -  1674098052889	Marionette	DEBUG	2 <- [1,6,null,{"value":null}]
[task 2023-01-19T03:14:12.890Z] 03:14:12     INFO -  1674098052889	Marionette	DEBUG	2 -> [0,7,"Marionette:GetContext",{}]
[task 2023-01-19T03:14:12.890Z] 03:14:12     INFO -  1674098052890	Marionette	DEBUG	2 <- [1,7,null,{"value":"chrome"}]
[task 2023-01-19T03:14:12.891Z] 03:14:12     INFO -  1674098052890	Marionette	DEBUG	2 -> [0,8,"Marionette:SetContext",{"value":"content"}]
[task 2023-01-19T03:14:12.891Z] 03:14:12     INFO -  1674098052890	Marionette	DEBUG	2 <- [1,8,null,{"value":null}]
[task 2023-01-19T03:14:12.891Z] 03:14:12     INFO -  1674098052891	Marionette	DEBUG	2 -> [0,9,"WebDriver:GetWindowHandles",{}]
[task 2023-01-19T03:14:12.892Z] 03:14:12     INFO -  1674098052892	Marionette	DEBUG	2 <- [1,9,null,["bdab0dd1-89b2-4dd4-b656-0dbaa879ef0e"]]
[task 2023-01-19T03:14:12.892Z] 03:14:12     INFO -  1674098052892	Marionette	DEBUG	2 -> [0,10,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-01-19T03:14:12.893Z] 03:14:12     INFO -  1674098052892	Marionette	DEBUG	2 <- [1,10,null,{"value":null}]
[task 2023-01-19T03:14:12.893Z] 03:14:12     INFO -  1674098052893	Marionette	DEBUG	2 -> [0,11,"Marionette:GetContext",{}]
[task 2023-01-19T03:14:12.894Z] 03:14:12     INFO -  1674098052894	Marionette	DEBUG	2 <- [1,11,null,{"value":"chrome"}]
[task 2023-01-19T03:14:12.895Z] 03:14:12     INFO -  1674098052894	Marionette	DEBUG	2 -> [0,12,"WebDriver:DeleteSession",{}]
[task 2023-01-19T03:14:12.897Z] 03:14:12     INFO -  1674098052897	Marionette	DEBUG	2 <- [1,12,null,{"value":null}]
[task 2023-01-19T03:14:12.982Z] 03:14:12     INFO -  Application command: Z:\task_167408882500176\build\application\firefox\firefox.exe -no-remote -marionette --wait-for-browser -profile C:\Users\task_167408882500176\AppData\Local\Temp\tmp2d68adl6.mozrunner
[task 2023-01-19T03:14:13.157Z] 03:14:13     INFO -  DEBUG: Adding blocker AddonManager: shutting down. for phase profile-before-change
[task 2023-01-19T03:14:13.174Z] 03:14:13     INFO -  DEBUG: Adding blocker IOUtils Blocker (profile-before-change) for phase profile-before-change
[task 2023-01-19T03:14:13.181Z] 03:14:13     INFO -  DEBUG: Adding blocker IOUtils Blocker (profile-before-change-telemetry) for phase profile-before-change-telemetry
[task 2023-01-19T03:14:13.181Z] 03:14:13     INFO -  DEBUG: Adding blocker IOUtils Blocker (profile-before-change) for phase IOUtils: waiting for sendTelemetry IO to complete
[task 2023-01-19T03:14:13.181Z] 03:14:13     INFO -  DEBUG: Adding blocker IOUtils Blocker (xpcom-will-shutdown) for phase xpcom-will-shutdown
[task 2023-01-19T03:14:13.182Z] 03:14:13     INFO -  DEBUG: Adding blocker IOUtils Blocker (profile-before-change-telemetry) for phase IOUtils: waiting for xpcomWillShutdown IO to complete
[task 2023-01-19T03:14:13.209Z] 03:14:13     INFO -  DEBUG: Adding blocker Flush WebExtension StartupCache for phase IOUtils: waiting for profileBeforeChange IO to complete
[task 2023-01-19T03:14:13.305Z] 03:14:13     INFO -  DEBUG: Adding blocker JSON store: writing data for 'addonStartup' for phase AddonManager: Waiting for providers to shut down.
[task 2023-01-19T03:14:13.309Z] 03:14:13     INFO -  DEBUG: Adding blocker Update add-on blocklist state into add-on DB for phase AddonManager: Waiting to start provider shutdown.
[task 2023-01-19T03:14:13.313Z] 03:14:13     INFO -  DEBUG: Adding blocker XPIProvider shutdown for phase quit-application-granted
[task 2023-01-19T03:14:13.314Z] 03:14:13     INFO -  DEBUG: Adding blocker XPIProvider for phase AddonManager: Waiting for providers to shut down.
[task 2023-01-19T03:14:13.314Z] 03:14:13     INFO -  DEBUG: Adding blocker ServiceWorkerRegistrar: Flushing data for phase profile-before-change
[task 2023-01-19T03:14:13.316Z] 03:14:13     INFO -  DEBUG: Adding blocker CrashMonitor: Writing notifications to file after receiving profile-before-change and awaiting all checkpoints written for phase IOUtils: waiting for profileBeforeChange IO to complete
[task 2023-01-19T03:14:13.327Z] 03:14:13     INFO -  DEBUG: Adding blocker TelemetryController: shutting down for phase profile-before-change-telemetry
[task 2023-01-19T03:14:13.361Z] 03:14:13     INFO -  DEBUG: Adding blocker EnvironmentAddonBuilder for phase AddonManager: Waiting to start provider shutdown.
[task 2023-01-19T03:14:13.374Z] 03:14:13     INFO -  DEBUG: Adding blocker RemoteSettingsClient - finish IDB access. for phase profile-before-change
[task 2023-01-19T03:14:13.377Z] 03:14:13     INFO -  DEBUG: Adding blocker TerminatoryTelemetry: Waiting to submit telemetry for phase IOUtils: waiting for sendTelemetry IO to complete
[task 2023-01-19T03:14:13.379Z] 03:14:13     INFO -  1674098053379	Marionette	INFO	Marionette enabled
[task 2023-01-19T03:14:13.380Z] 03:14:13     INFO -  1674098053380	Marionette	TRACE	Received observer notification final-ui-startup
[task 2023-01-19T03:14:13.381Z] 03:14:13     INFO -  1674098053382	Marionette	INFO	Listening on port 2828
[task 2023-01-19T03:14:13.382Z] 03:14:13     INFO -  1674098053382	Marionette	DEBUG	Marionette is listening
[task 2023-01-19T03:17:25.136Z] 03:17:25    ERROR -  TEST-UNEXPECTED-ERROR | browser/components/sessionstore/test/marionette/test_restore_windows_after_restart_and_quit.py TestSessionStoreDisabled.test_no_restore_with_quit | marionette_driver.errors.InvalidSessionIdException: Please start a session
[task 2023-01-19T03:17:25.137Z] 03:17:25     INFO -  Traceback (most recent call last):
[task 2023-01-19T03:17:25.137Z] 03:17:25     INFO -    File "Z:\task_167408882500176\build\venv\lib\site-packages\marionette_harness\marionette_test\testcases.py", line 231, in run
[task 2023-01-19T03:17:25.138Z] 03:17:25     INFO -      self.tearDown()
[task 2023-01-19T03:17:25.138Z] 03:17:25     INFO -    File "Z:\task_167408882500176\build\tests\marionette\tests\browser\components\sessionstore\test\marionette\session_store_test_case.py", line 92, in tearDown
[task 2023-01-19T03:17:25.138Z] 03:17:25     INFO -      super(SessionStoreTestCase, self).tearDown()
[task 2023-01-19T03:17:25.139Z] 03:17:25     INFO -    File "Z:\task_167408882500176\build\venv\lib\site-packages\marionette_harness\runner\mixins\window_manager.py", line 22, in tearDown
[task 2023-01-19T03:17:25.139Z] 03:17:25     INFO -      if len(self.marionette.chrome_window_handles) > len(self.start_windows):
[task 2023-01-19T03:17:25.139Z] 03:17:25     INFO -    File "Z:\task_167408882500176\build\venv\lib\site-packages\marionette_driver\marionette.py", line 1413, in chrome_window_handles
[task 2023-01-19T03:17:25.139Z] 03:17:25     INFO -      with self.using_context("chrome"):
[task 2023-01-19T03:17:25.140Z] 03:17:25     INFO -    File "c:\mozilla-build\python3\lib\contextlib.py", line 117, in __enter__
[task 2023-01-19T03:17:25.140Z] 03:17:25     INFO -      return next(self.gen)
[task 2023-01-19T03:17:25.140Z] 03:17:25     INFO -    File "Z:\task_167408882500176\build\venv\lib\site-packages\marionette_driver\marionette.py", line 1482, in using_context
[task 2023-01-19T03:17:25.140Z] 03:17:25     INFO -      scope = self._send_message("Marionette:GetContext", key="value")
[task 2023-01-19T03:17:25.141Z] 03:17:25     INFO -    File "Z:\task_167408882500176\build\venv\lib\site-packages\marionette_driver\decorators.py", line 24, in _
[task 2023-01-19T03:17:25.141Z] 03:17:25     INFO -      return func(*args, **kwargs)
[task 2023-01-19T03:17:25.141Z] 03:17:25     INFO -    File "Z:\task_167408882500176\build\venv\lib\site-packages\marionette_driver\marionette.py", line 653, in _send_message
[task 2023-01-19T03:17:25.141Z] 03:17:25     INFO -      raise errors.InvalidSessionIdException("Please start a session")
[task 2023-01-19T03:17:25.142Z] 03:17:25     INFO -  TEST-INFO took 199014ms
[task 2023-01-19T03:17:25.143Z] 03:17:25     INFO -  TEST-START | browser/components/sessionstore/test/marionette/test_restore_windows_after_restart_and_quit.py 
```