Infleqtion / client-superstaq

https://superstaq.readthedocs.io
Apache License 2.0
89 stars 19 forks source link

`docs/source/optimizations/qscout/qscout_css.ipynb` notebook test flakes #1104

Open natibek opened 1 week ago

natibek commented 1 week ago

What is happening?

Workflow test failure for notebook docs/source/optimizations/qscout/qscout_css.ipynb with error ERROR traitlets:client.py:567 Error occurred while starting new kernel client for kernel 88152613-62e1-40f8-8d8d-f2590156b679: Kernel died before replying to kernel_info.

Notebook check for cirq-superstaq

Notebook check for cirq-superstaq failure ```bash ============================= test session starts ============================== platform linux -- Python 3.13.0, pytest-8.3.3, pluggy-1.5.0 -- /opt/hostedtoolcache/Python/3.13.0/x64/bin/python cachedir: .pytest_cache Using --randomly-seed=2837684675 rootdir: /home/runner/work/client-superstaq/client-superstaq configfile: pyproject.toml plugins: randomly-3.16.0, anyio-4.6.2.post1, nbmake-1.5.4, cov-6.0.0, socket-0.7.0, xdist-3.6.1 created: 9/9 workers 9 workers [9 items] scheduling tests via LoadScheduling docs/source/optimizations/aqt/aqt_css.ipynb:: docs/source/get_started/access_info/access_info_css.ipynb:: cirq-superstaq/docs/getting_started_cirq_superstaq.ipynb:: docs/source/optimizations/sqorpius/sqorpius_compile_css.ipynb:: docs/source/optimizations/ibm/ibmq_compile_css.ipynb:: docs/source/get_started/basics/basics_css.ipynb:: cirq-superstaq/examples/resource_estimate.ipynb:: cirq-superstaq/docs/ibm_cirq_superstaq.ipynb:: docs/source/optimizations/qscout/qscout_css.ipynb:: [gw8] [ 11%] FAILED docs/source/optimizations/qscout/qscout_css.ipynb:: [gw2] [ 22%] PASSED cirq-superstaq/docs/ibm_cirq_superstaq.ipynb:: [gw1] [ 33%] PASSED cirq-superstaq/docs/getting_started_cirq_superstaq.ipynb:: [gw3] [ 44%] PASSED docs/source/get_started/basics/basics_css.ipynb:: [gw5] [ 55%] PASSED docs/source/optimizations/ibm/ibmq_compile_css.ipynb:: [gw0] [ 66%] PASSED cirq-superstaq/examples/resource_estimate.ipynb:: [gw7] [ 77%] PASSED docs/source/get_started/access_info/access_info_css.ipynb:: [gw4] [ 88%] PASSED docs/source/optimizations/sqorpius/sqorpius_compile_css.ipynb:: Exception ignored in atexit callback .wrapped of >: Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/util.py", line 85, in wrapped return just_run(coro(*args, **kwargs)) File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/util.py", line 60, in just_run return loop.run_until_complete(coro) File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/asyncio/base_events.py", line 721, in run_until_complete return future.result() File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/client.py", line 503, in _async_cleanup_kernel assert self.km is not None AssertionError: [gw6] [100%] PASSED docs/source/optimizations/aqt/aqt_css.ipynb:: =================================== FAILURES =================================== _ /home/runner/work/client-superstaq/client-superstaq/docs/source/optimizations/qscout/qscout_css.ipynb _ [gw8] linux -- Python 3.13.0 /opt/hostedtoolcache/Python/3.13.0/x64/bin/python NBMAKE INTERNAL ERROR Kernel died before replying to kernel_info File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/runner.py", line 341, in from_call result: TResult | None = func() ~~~~^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/runner.py", line 242, in lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_hooks.py", line 513, in __call__ return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 139, in _multicall raise exception.with_traceback(exception.__traceback__) File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/threadexception.py", line 92, in pytest_runtest_call yield from thread_exception_runtest_hook() File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook yield File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/unraisableexception.py", line 95, in pytest_runtest_call yield from unraisable_exception_runtest_hook() File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook yield File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/logging.py", line 846, in pytest_runtest_call yield from self._runtest_for(item, "call") File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/logging.py", line 829, in _runtest_for yield File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/capture.py", line 880, in pytest_runtest_call return (yield) ^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 122, in _multicall teardown.throw(exception) # type: ignore[union-attr] ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/skipping.py", line 257, in pytest_runtest_call return (yield) ^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/pluggy/_callers.py", line 103, in _multicall res = hook_impl.function(*args) File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/_pytest/runner.py", line 174, in pytest_runtest_call item.runtest() ~~~~~~~~~~~~^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbmake/pytest_items.py", line 54, in runtest res: NotebookResult = run.execute() ~~~~~~~~~~~^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbmake/nb_run.py", line 131, in execute raise err File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbmake/nb_run.py", line 113, in execute c.execute(cwd=self.filename.parent) ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/util.py", line 85, in wrapped return just_run(coro(*args, **kwargs)) File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/util.py", line 60, in just_run return loop.run_until_complete(coro) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/asyncio/base_events.py", line 721, in run_until_complete return future.result() ~~~~~~~~~~~~~^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/client.py", line 691, in async_execute async with self.async_setup_kernel(**kwargs): ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/contextlib.py", line 214, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/client.py", line 649, in async_setup_kernel await self.async_start_new_kernel_client() File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/client.py", line 565, in async_start_new_kernel_client await ensure_async(self.kc.wait_for_ready(timeout=self.startup_timeout)) # type:ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/nbclient/util.py", line 97, in ensure_async result = await obj ^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/jupyter_client/client.py", line 203, in _async_wait_for_ready raise RuntimeError(msg) ----------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/ipykernel_launcher.py", line 18, in app.launch_new_instance() ~~~~~~~~~~~~~~~~~~~~~~~^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/traitlets/config/application.py", line 1074, in launch_instance app.initialize(argv) ~~~~~~~~~~~~~~^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/traitlets/config/application.py", line 118, in inner return method(app, *args, **kwargs) File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/ipykernel/kernelapp.py", line 692, in initialize self.init_sockets() ~~~~~~~~~~~~~~~~~^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/ipykernel/kernelapp.py", line 331, in init_sockets self.shell_port = self._bind_socket(self.shell_socket, self.shell_port) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/ipykernel/kernelapp.py", line 253, in _bind_socket return self._try_bind_socket(s, port) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/ipykernel/kernelapp.py", line 229, in _try_bind_socket s.bind("tcp://%s:%i" % (self.ip, port)) ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.13.0/x64/lib/python3.13/site-packages/zmq/sugar/socket.py", line 311, in bind super().bind(addr) ~~~~~~~~~~~~^^^^^^ File "_zmq.py", line 917, in zmq.backend.cython._zmq.Socket.bind File "_zmq.py", line 179, in zmq.backend.cython._zmq._check_rc zmq.error.ZMQError: Address already in use (addr='tcp://127.0.0.1:[58](https://github.com/Infleqtion/client-superstaq/actions/runs/11825920687/job/32950782014#step:5:59)255') ------------------------------ Captured log call ------------------------------- ERROR traitlets:client.py:567 Error occurred while starting new kernel client for kernel 88152613-62e1-40f8-8d8d-f2[59](https://github.com/Infleqtion/client-superstaq/actions/runs/11825920687/job/32950782014#step:5:60)0156b679: Kernel died before replying to kernel_info * nbmake: Automate reading GitHub Actions logs with our bot: https://github.com/marketplace/treebeard-build =========================== short test summary info ============================ FAILED docs/source/optimizations/qscout/qscout_css.ipynb:: =================== 1 failed, 8 passed in 135.03s (0:02:15) ==================== ```

How can we reproduce the issue?

It fails randomly when testing with Github actions.

What should happen?

PRs where it fails do not include changes to the file. It should not be failing.

Environment

Any additional context?

No response

bharat-thotakura commented 1 week ago

Another recent occurrence back to back: https://github.com/Infleqtion/client-superstaq/actions/runs/11845243213/job/33010280594?pr=1102 & https://github.com/Infleqtion/client-superstaq/actions/runs/11845243213/job/33010860701?pr=1102