diff --git a/subiquity/tests/api/test_api.py b/subiquity/tests/api/test_api.py index 779c4f2a..b3dfd667 100755 --- a/subiquity/tests/api/test_api.py +++ b/subiquity/tests/api/test_api.py @@ -920,6 +920,12 @@ class TestCancel(TestAPI): async def test_cancel_drivers(self): with patch.dict(os.environ, {'SUBIQUITY_DEBUG': 'has-drivers'}): async with start_server('examples/simple.json') as inst: + # /drivers?wait=true is expected to block until APT is + # configured. + # Let's make sure we cancel it. + with self.assertRaises(asyncio.TimeoutError): + await asyncio.wait_for(inst.get('/drivers', wait=True), + 0.1) names = ['locale', 'keyboard', 'source', 'network', 'proxy', 'mirror', 'storage'] await inst.post('/meta/mark_configured', endpoint_names=names) @@ -927,12 +933,6 @@ class TestCancel(TestAPI): await inst.post('/meta/confirm', tty='/dev/tty1') await inst.get('/meta/status', cur='NEEDS_CONFIRMATION') - try: - await asyncio.wait_for(inst.get('/drivers', wait=True), - 0.001) - except asyncio.exceptions.TimeoutError: - pass - # should not raise ServerDisconnectedError resp = await inst.get('/drivers', wait=True) self.assertEqual(['nvidia-driver-470-server'], resp['drivers'])