Bug: Intermittent browser/components/places/tests/marionette/test_reopen_from_library.py TestReopenFromLibrary.test_open_bookmark_from_library_with_no_browser_window_open | OSError: Process has been unexpectedly closed (Exit code: 2147483651) (Reason: [WinErro
Status: RESOLVED
Priority: P5
Resolution: INCOMPLETE
Created: 2023-07-17 00:47:52+00:00
Resolved: 2023-11-13 12:01:02+00:00

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

---
```
[task 2023-07-16T23:58:30.876Z] 23:58:30     INFO -  DEBUG: Completed blocker SessionFile: Finish writing Session Restore data for phase IOUtils: waiting for profileBeforeChange IO to complete
[task 2023-07-16T23:58:30.879Z] 23:58:30     INFO -  1689551910878	Marionette	DEBUG	2 -> [0,69,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:30.879Z] 23:58:30     INFO -  1689551910879	Marionette	DEBUG	2 <- [1,69,null,{"value":null}]
[task 2023-07-16T23:58:30.880Z] 23:58:30     INFO -  1689551910880	Marionette	DEBUG	2 -> [0,70,"Marionette:GetContext",{}]
[task 2023-07-16T23:58:30.880Z] 23:58:30     INFO -  1689551910881	Marionette	DEBUG	2 <- [1,70,null,{"value":"chrome"}]
[task 2023-07-16T23:58:30.882Z] 23:58:30     INFO -  1689551910882	Marionette	DEBUG	2 -> [0,71,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:30.883Z] 23:58:30     INFO -  1689551910882	Marionette	DEBUG	2 <- [1,71,null,{"value":null}]
[task 2023-07-16T23:58:30.884Z] 23:58:30     INFO -  1689551910884	Marionette	DEBUG	2 -> [0,72,"WebDriver:GetWindowHandles",{}]
[task 2023-07-16T23:58:30.884Z] 23:58:30     INFO -  1689551910884	Marionette	DEBUG	2 <- [1,72,null,["f94056b0-2b89-42a7-9521-989a8acf2f8d","3dc4ac54-d4ae-4d7f-a41e-c89fc1008617"]]
[task 2023-07-16T23:58:30.886Z] 23:58:30     INFO -  1689551910886	Marionette	DEBUG	2 -> [0,73,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:30.886Z] 23:58:30     INFO -  1689551910886	Marionette	DEBUG	2 <- [1,73,null,{"value":null}]
[task 2023-07-16T23:58:30.887Z] 23:58:30     INFO -  1689551910887	Marionette	DEBUG	2 -> [0,74,"Marionette:GetContext",{}]
[task 2023-07-16T23:58:30.887Z] 23:58:30     INFO -  1689551910887	Marionette	DEBUG	2 <- [1,74,null,{"value":"chrome"}]
[task 2023-07-16T23:58:30.889Z] 23:58:30     INFO -  1689551910889	Marionette	DEBUG	2 -> [0,75,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:30.889Z] 23:58:30     INFO -  1689551910889	Marionette	DEBUG	2 <- [1,75,null,{"value":null}]
[task 2023-07-16T23:58:30.892Z] 23:58:30     INFO -  1689551910891	Marionette	DEBUG	2 -> [0,76,"WebDriver:ExecuteScript",{"script":"const { windowManager } = ChromeUtils.importESModule(\n                    \"chrome://remote/content/shared/WindowManager.sys.m ... nst win = windowManager.findWindowByHandle(arguments[0]).win;\n                  return win.document.readyState == \"complete\";","args":["3dc4ac54-d4ae-4d7f-a41e-c89fc1008617"],"newSandbox":true,"sandbox":"default","line":95,"filename":"Z:\\task_168954713402782\\build\\venv\\lib\\site-packages\\marionette_harness\\runner\\mixins\\window_manager.py"}]
[task 2023-07-16T23:58:30.898Z] 23:58:30     INFO -  1689551910902	Marionette	DEBUG	2 <- [1,76,null,{"value":false}]
[task 2023-07-16T23:58:30.903Z] 23:58:30     INFO -  1689551910905	Marionette	DEBUG	2 -> [0,77,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:30.906Z] 23:58:30     INFO -  1689551910906	Marionette	DEBUG	2 <- [1,77,null,{"value":null}]
[task 2023-07-16T23:58:31.076Z] 23:58:31     INFO -  1689551911089	Marionette	DEBUG	2 -> [0,78,"Marionette:GetContext",{}]
[task 2023-07-16T23:58:31.089Z] 23:58:31     INFO -  1689551911089	Marionette	DEBUG	2 <- [1,78,null,{"value":"chrome"}]
[task 2023-07-16T23:58:31.279Z] 23:58:31     INFO -  1689551911288	Marionette	DEBUG	2 -> [0,79,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:31.279Z] 23:58:31     INFO -  1689551911288	Marionette	DEBUG	2 <- [1,79,null,{"value":null}]
[task 2023-07-16T23:58:31.311Z] 23:58:31     INFO -  1689551911314	Marionette	DEBUG	2 -> [0,80,"WebDriver:ExecuteScript",{"script":"const { windowManager } = ChromeUtils.importESModule(\n                    \"chrome://remote/content/shared/WindowManager.sys.m ... nst win = windowManager.findWindowByHandle(arguments[0]).win;\n                  return win.document.readyState == \"complete\";","args":["3dc4ac54-d4ae-4d7f-a41e-c89fc1008617"],"newSandbox":true,"sandbox":"default","line":95,"filename":"Z:\\task_168954713402782\\build\\venv\\lib\\site-packages\\marionette_harness\\runner\\mixins\\window_manager.py"}]
[task 2023-07-16T23:58:31.323Z] 23:58:31     INFO -  1689551911323	Marionette	DEBUG	2 <- [1,80,null,{"value":true}]
[task 2023-07-16T23:58:31.325Z] 23:58:31     INFO -  1689551911325	Marionette	DEBUG	2 -> [0,81,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:31.325Z] 23:58:31     INFO -  1689551911325	Marionette	DEBUG	2 <- [1,81,null,{"value":null}]
[task 2023-07-16T23:58:31.326Z] 23:58:31     INFO -  1689551911326	Marionette	DEBUG	2 -> [0,82,"Marionette:GetContext",{}]
[task 2023-07-16T23:58:31.327Z] 23:58:31     INFO -  1689551911326	Marionette	DEBUG	2 <- [1,82,null,{"value":"chrome"}]
[task 2023-07-16T23:58:31.328Z] 23:58:31     INFO -  1689551911327	Marionette	DEBUG	2 -> [0,83,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:31.328Z] 23:58:31     INFO -  1689551911328	Marionette	DEBUG	2 <- [1,83,null,{"value":null}]
[task 2023-07-16T23:58:31.329Z] 23:58:31     INFO -  1689551911329	Marionette	DEBUG	2 -> [0,84,"WebDriver:CloseChromeWindow",{}]
[task 2023-07-16T23:58:31.568Z] 23:58:31     INFO -  1689551911571	Marionette	TRACE	Received observer notification xul-window-destroyed
[task 2023-07-16T23:58:31.571Z] 23:58:31     INFO -  1689551911571	Marionette	DEBUG	2 <- [1,84,null,["3dc4ac54-d4ae-4d7f-a41e-c89fc1008617"]]
[task 2023-07-16T23:58:31.609Z] 23:58:31     INFO -  1689551911613	Marionette	TRACE	[1] MarionetteCommands actor destroyed for window id 2
[task 2023-07-16T23:58:31.624Z] 23:58:31     INFO -  1689551911631	Marionette	DEBUG	2 -> [0,85,"WebDriver:SwitchToWindow",{"handle":"3dc4ac54-d4ae-4d7f-a41e-c89fc1008617","focus":true}]
[task 2023-07-16T23:58:31.633Z] 23:58:31     INFO -  1689551911632	Marionette	DEBUG	2 <- [1,85,null,{"value":null}]
[task 2023-07-16T23:58:31.637Z] 23:58:31     INFO -  1689551911636	Marionette	DEBUG	2 -> [0,86,"WebDriver:ExecuteScript",{"script":"window.PlacesOrganizer.selectLeftPaneContainerByHierarchy(\n  PlacesUtils.bookmarks.virtualToolbarGuid\n);\n\nlet node = window.C ... + rect.height / 2;\nlet treeBodyRect = tree.body.getBoundingClientRect();\nreturn [treeBodyRect.left + x, treeBodyRect.top + y]","args":[],"newSandbox":true,"sandbox":"default","line":89,"filename":"Z:\\task_168954713402782\\build\\tests\\marionette\\tests\\browser\\components\\places\\tests\\marionette\\test_reopen_from_library.py"}]
[task 2023-07-16T23:58:31.638Z] 23:58:31     INFO -  1689551911638	Marionette	TRACE	[13] MarionetteCommands actor created for window id 28
[task 2023-07-16T23:58:31.749Z] 23:58:31     INFO -  1689551911754	Marionette	DEBUG	2 <- [1,86,null,{"value":[278,60]}]
[task 2023-07-16T23:58:31.766Z] 23:58:31     INFO -  1689551911767	Marionette	DEBUG	2 -> [0,87,"WebDriver:PerformActions",{"actions":[{"type":"pointer","id":"pointer_id","actions":[{"type":"pointerMove","x":278,"y":60},{"type":"pointerDown","button":0},{"type":"pointerUp","button":0},{"type":"pointerDown","button":0},{"type":"pointerUp","button":0}],"parameters":{"pointerType":"mouse"}}]}]
[task 2023-07-16T23:58:31.780Z] 23:58:31     INFO -  1689551911787	Marionette	TRACE	Dispatching tick 1/5
[task 2023-07-16T23:58:31.788Z] 23:58:31     INFO -  1689551911787	Marionette	TRACE	Dispatch PointerMoveAction mouse with id: pointer_id x: 278 y: 60
[task 2023-07-16T23:58:31.788Z] 23:58:31     INFO -  1689551911788	Marionette	TRACE	moveOverTime start: 0,0 target: 278,60 duration: 0
[task 2023-07-16T23:58:31.789Z] 23:58:31     INFO -  1689551911788	Marionette	TRACE	PointerMoveAction.performPointerMoveStep [278,60]
[task 2023-07-16T23:58:31.800Z] 23:58:31     INFO -  1689551911810	Marionette	TRACE	Dispatching tick 2/5
[task 2023-07-16T23:58:31.800Z] 23:58:31     INFO -  1689551911811	Marionette	TRACE	Dispatch PointerDownAction mouse with id: pointer_id button: 0
[task 2023-07-16T23:58:31.813Z] 23:58:31     INFO -  1689551911813	Marionette	TRACE	Dispatching tick 3/5
[task 2023-07-16T23:58:31.813Z] 23:58:31     INFO -  1689551911813	Marionette	TRACE	Dispatch PointerUpAction mouse with id: pointer_id button: 0
[task 2023-07-16T23:58:31.816Z] 23:58:31     INFO -  1689551911816	Marionette	TRACE	Dispatching tick 4/5
[task 2023-07-16T23:58:31.816Z] 23:58:31     INFO -  1689551911816	Marionette	TRACE	Dispatch PointerDownAction mouse with id: pointer_id button: 0
[task 2023-07-16T23:58:31.819Z] 23:58:31     INFO -  1689551911818	Marionette	TRACE	Dispatching tick 5/5
[task 2023-07-16T23:58:31.819Z] 23:58:31     INFO -  1689551911818	Marionette	TRACE	Dispatch PointerUpAction mouse with id: pointer_id button: 0
[task 2023-07-16T23:58:31.830Z] 23:58:31     INFO -  1689551911839	Marionette	TRACE	Received observer notification domwindowopened
[task 2023-07-16T23:58:31.868Z] 23:58:31     INFO -  1689551911868	Marionette	DEBUG	2 <- [1,87,null,{"value":null}]
[task 2023-07-16T23:58:32.282Z] 23:58:32     INFO -  1689551912290	Marionette	DEBUG	2 -> [0,88,"Marionette:GetContext",{}]
[task 2023-07-16T23:58:32.282Z] 23:58:32     INFO -  1689551912290	Marionette	DEBUG	2 <- [1,88,null,{"value":"chrome"}]
[task 2023-07-16T23:58:32.439Z] 23:58:32     INFO -  1689551912437	Marionette	DEBUG	2 -> [0,89,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:32.439Z] 23:58:32     INFO -  1689551912437	Marionette	DEBUG	2 <- [1,89,null,{"value":null}]
[task 2023-07-16T23:58:32.471Z] 23:58:32     INFO -  1689551912481	Marionette	TRACE	Received observer notification browser-delayed-startup-finished
[task 2023-07-16T23:58:32.471Z] 23:58:32     INFO -  1689551912481	Marionette	TRACE	Received observer notification browser-delayed-startup-finished
[task 2023-07-16T23:58:32.503Z] 23:58:32     INFO -  1689551912509	Marionette	DEBUG	2 -> [0,90,"WebDriver:GetWindowHandles",{}]
[task 2023-07-16T23:58:32.509Z] 23:58:32     INFO -  1689551912509	Marionette	DEBUG	2 <- [1,90,null,["3dc4ac54-d4ae-4d7f-a41e-c89fc1008617","7d9d294a-f7f6-405f-b0ec-7f5815e0af2f"]]
[task 2023-07-16T23:58:32.518Z] 23:58:32     INFO -  FATAL ERROR: Non-local network connections are disabled and a connection attempt to www.mozilla.org (108.138.92.201) was made.
[task 2023-07-16T23:58:32.518Z] 23:58:32     INFO -  You should only access hostnames available via the test networking proxy (if running mochitests) or from a test-specific httpd.js server (if running xpcshell tests). Browser services should be disabled or redirected to a local server.
[task 2023-07-16T23:58:32.524Z] 23:58:32     INFO -  FATAL ERROR: Non-local network connections are disabled and a connection attempt to www.mozilla.org (108.138.92.201) was made.
[task 2023-07-16T23:58:32.524Z] 23:58:32     INFO -  You should only access hostnames available via the test networking proxy (if running mochitests) or from a test-specific httpd.js server (if running xpcshell tests). Browser services should be disabled or redirected to a local server.
[task 2023-07-16T23:58:32.527Z] 23:58:32     INFO -  FATAL ERROR: Non-local network connections are disabled and a connection attempt to www.mozilla.org (108.138.92.201) was made.
[task 2023-07-16T23:58:32.527Z] 23:58:32     INFO -  You should only access hostnames available via the test networking proxy (if running mochitests) or from a test-specific httpd.js server (if running xpcshell tests). Browser services should be disabled or redirected to a local server.
[task 2023-07-16T23:58:32.527Z] 23:58:32     INFO -  1689551912527	Marionette	DEBUG	2 -> [0,91,"Marionette:SetContext",{"value":"chrome"}]
[task 2023-07-16T23:58:32.527Z] 23:58:32     INFO -  1689551912527	Marionette	DEBUG	2 <- [1,91,null,{"value":null}]
[task 2023-07-16T23:58:32.539Z] 23:58:32     INFO -  Exiting due to channel error.
[task 2023-07-16T23:58:32.690Z] 23:58:32    ERROR -  TEST-UNEXPECTED-ERROR | browser/components/places/tests/marionette/test_reopen_from_library.py TestReopenFromLibrary.test_open_bookmark_from_library_with_no_browser_window_open | OSError: Process has been unexpectedly closed (Exit code: 2147483651) (Reason: [WinError 10054] An existing connection was forcibly closed by the remote host)
[task 2023-07-16T23:58:32.690Z] 23:58:32     INFO -  Traceback (most recent call last):
[task 2023-07-16T23:58:32.695Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_harness\marionette_test\testcases.py", line 198, in run
[task 2023-07-16T23:58:32.695Z] 23:58:32     INFO -      testMethod()
[task 2023-07-16T23:58:32.695Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\tests\marionette\tests\browser\components\places\tests\marionette\test_reopen_from_library.py", line 106, in test_open_bookmark_from_library_with_no_browser_window_open
[task 2023-07-16T23:58:32.696Z] 23:58:32     INFO -      Wait(self.marionette).until(
[task 2023-07-16T23:58:32.696Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\wait.py", line 131, in until
[task 2023-07-16T23:58:32.696Z] 23:58:32     INFO -      rv = condition(self.marionette)
[task 2023-07-16T23:58:32.696Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\tests\marionette\tests\browser\components\places\tests\marionette\test_reopen_from_library.py", line 99, in window_with_url_open
[task 2023-07-16T23:58:32.696Z] 23:58:32     INFO -      urls_in_windows = self.get_urls_for_windows()
[task 2023-07-16T23:58:32.696Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\tests\marionette\tests\browser\components\places\tests\marionette\test_reopen_from_library.py", line 123, in get_urls_for_windows
[task 2023-07-16T23:58:32.697Z] 23:58:32     INFO -      urls = tuple(self.get_urls_for_window(win))
[task 2023-07-16T23:58:32.697Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\tests\marionette\tests\browser\components\places\tests\marionette\test_reopen_from_library.py", line 129, in get_urls_for_window
[task 2023-07-16T23:58:32.698Z] 23:58:32     INFO -      orig_handle = self.marionette.current_chrome_window_handle
[task 2023-07-16T23:58:32.698Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\marionette.py", line 1380, in current_chrome_window_handle
[task 2023-07-16T23:58:32.698Z] 23:58:32     INFO -      with self.using_context("chrome"):
[task 2023-07-16T23:58:32.698Z] 23:58:32     INFO -    File "c:\mozilla-build\python3\lib\contextlib.py", line 119, in __enter__
[task 2023-07-16T23:58:32.698Z] 23:58:32     INFO -      return next(self.gen)
[task 2023-07-16T23:58:32.699Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\marionette.py", line 1511, in using_context
[task 2023-07-16T23:58:32.699Z] 23:58:32     INFO -      scope = self._send_message("Marionette:GetContext", key="value")
[task 2023-07-16T23:58:32.699Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\decorators.py", line 34, in _
[task 2023-07-16T23:58:32.699Z] 23:58:32     INFO -      m._handle_socket_failure()
[task 2023-07-16T23:58:32.699Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\marionette.py", line 769, in _handle_socket_failure
[task 2023-07-16T23:58:32.699Z] 23:58:32     INFO -      reraise(
[task 2023-07-16T23:58:32.700Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\six.py", line 702, in reraise
[task 2023-07-16T23:58:32.700Z] 23:58:32     INFO -      raise value.with_traceback(tb)
[task 2023-07-16T23:58:32.700Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\decorators.py", line 24, in _
[task 2023-07-16T23:58:32.700Z] 23:58:32     INFO -      return func(*args, **kwargs)
[task 2023-07-16T23:58:32.700Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\marionette.py", line 685, in _send_message
[task 2023-07-16T23:58:32.700Z] 23:58:32     INFO -      msg = self.client.request(name, params)
[task 2023-07-16T23:58:32.701Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\transport.py", line 382, in request
[task 2023-07-16T23:58:32.701Z] 23:58:32     INFO -      return self.receive()
[task 2023-07-16T23:58:32.701Z] 23:58:32     INFO -    File "Z:\task_168954713402782\build\venv\lib\site-packages\marionette_driver\transport.py", line 223, in receive
[task 2023-07-16T23:58:32.701Z] 23:58:32     INFO -      chunk = sock.recv(recv_bytes)
[task 2023-07-16T23:58:32.701Z] 23:58:32     INFO -  TEST-INFO took 4125ms
[task 2023-07-16T23:58:32.705Z] 23:58:32     INFO -  test_end for browser/components/places/tests/marionette/test_reopen_from_library.py TestReopenFromLibrary.test_open_bookmark_from_library_with_no_browser_window_open logged while not in progress. Logged with data: {"message": "marionette_driver.errors.InvalidSessionIdException: Please start a session", "expected": "PASS", "stack": "Traceback (most recent call last):\n  File \"Z:\\task_168954713402782\\build\\venv\\lib\\site-packages\\marionette_harness\\marionette_test\\testcases.py\", line 231, in run\n    self.tearDown()\n  File \"Z:\\task_168954713402782\\build\\tests\\marionette\\tests\\browser\\components\\places\\tests\\marionette\\test_reopen_from_library.py\", line 28, in tearDown\n    self.close_all_windows()\n  File \"Z:\\task_168954713402782\\build\\venv\\lib\\site-packages\\marionette_harness\\runner\\mixins\\window_manager.py\", line 45, in close_all_windows\n    current_chrome_window_handles = self.marionette.chrome_window_handles\n  File \"Z:\\task_168954713402782\\build\\venv\\lib\\site-packages\\marionette_driver\\marionette.py\", line 1442, in chrome_window_handles\n    with self.using_context(\"chrome\"):\n  File \"c:\\mozilla-build\\python3\\lib\\contextlib.py\", line 119, in __enter__\n    return next(self.gen)\n  File \"Z:\\task_168954713402782\\build\\venv\\lib\\site-packages\\marionette_driver\\marionette.py\", line 1511, in using_context\n    scope = self._send_message(\"Marionette:GetContext\", key=\"value\")\n  File \"Z:\\task_168954713402782\\build\\venv\\lib\\site-packages\\marionette_driver\\decorators.py\", line 24, in _\n    return func(*args, **kwargs)\n  File \"Z:\\task_168954713402782\\build\\venv\\lib\\site-packages\\marionette_driver\\marionette.py\", line 682, in _send_message\n    raise errors.InvalidSessionIdException(\"Please start a session\")\n", "extra": {"class_name": "test_reopen_from_library.TestReopenFromLibrary", "method_name": "test_open_bookmark_from_library_with_no_browser_window_open"}, "test": "browser/components/places/tests/marionette/test_reopen_from_library.py TestReopenFromLibrary.test_open_bookmark_from_library_with_no_browser_window_open", "status": "ERROR"}
[task 2023-07-16T23:58:32.705Z] 23:58:32     INFO -  TEST-START | browser/components/search/test/marionette/test_engines_on_restart.py TestEnginesOnRestart.test_engines
```