quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.24k stars 1.01k forks source link

CI runs failing on Windows #6741

Open mhucka opened 5 days ago

mhucka commented 5 days ago

The latest continuous integration workflow run failed on Windows due to an error in one of the pytest tests. It is not clear what is happening.

[gw1] win32 -- Python 3.10.11 C:\hostedtoolcache\windows\Python\3.10.11\x64\python.exe

self = <cirq_google.engine.stream_manager_test.TestStreamManager object at 0x0000027D0F4171C0>
client_constructor = <MagicMock name='QuantumEngineServiceAsyncClient' spec='QuantumEngineServiceAsyncClient' id='2736223189552'>
error = ServiceUnavailable('unavailable')

    @pytest.mark.parametrize(
        'error',
        [
            google_exceptions.InternalServerError('server error'),
            google_exceptions.ServiceUnavailable('unavailable'),
            google_exceptions.Unknown('timeout'),
        ],
    )
    @mock.patch.object(quantum, 'QuantumEngineServiceAsyncClient', autospec=True)
    def test_submit_with_retryable_stream_breakage_expects_get_result_request(
        self, client_constructor, error
    ):
        expected_result = quantum.QuantumResult(parent='projects/proj/programs/prog/jobs/job0')
        fake_client, manager = setup(client_constructor)

        async def test():
            async with duet.timeout_scope(5):
                actual_result_future = manager.submit(
                    REQUEST_PROJECT_NAME, REQUEST_PROGRAM, REQUEST_JOB0
                )
                await fake_client.wait_for_requests()
                await fake_client.reply(error)
                await fake_client.wait_for_requests()
                await fake_client.reply(quantum.QuantumRunStreamResponse(result=expected_result))
                await actual_result_future
                manager.stop()

                assert len(fake_client.all_stream_requests) == 2
                assert 'create_quantum_program_and_job' in fake_client.all_stream_requests[0]
                assert 'get_quantum_result' in fake_client.all_stream_requests[1]

>       duet.run(test)

cirq-google\cirq_google\engine\stream_manager_test.py:393: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\duet\api.py:60: in run
    scheduler.tick()
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\duet\impl.py:406: in tick
    task.advance()
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\duet\impl.py:129: in advance
    f = next(self._generator)
cirq-google\cirq_google\engine\stream_manager_test.py:382: in test
    await fake_client.wait_for_requests()
cirq-google\cirq_google\engine\stream_manager_test.py:141: in wait_for_requests
    requests.append(await self._request_buffer.__anext__())
C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\duet\aitertools.py:109: in __anext__
    await self._waiter
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <AwaitableFuture at 0x27d11804760 state=cancelled>

    def __await__(self) -> Generator["AwaitableFuture[T]", None, T]:
>       yield self
E       TimeoutError

C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\duet\futuretools.py:87: TimeoutError