test(images): prove a cancelled walk starts no trailing walk (#348, PR 2)
The previous assertions held even with the trailing walk, because that walk finished before they ran; assert the walk number and the scan count.
This commit is contained in:
@@ -3494,10 +3494,14 @@ class TestSharedListing(ImageAPITestCase):
|
||||
await self.scan.wait_entered()
|
||||
self.api.mark_root_dirty(self._output("c.png"))
|
||||
(task,) = self.api._listing_tasks
|
||||
seq = record.walk_seq
|
||||
task.cancel() # e.g. the loop shutting down without on_cleanup
|
||||
await asyncio.gather(task, return_exceptions=True)
|
||||
gate.set()
|
||||
await self._settle()
|
||||
self.assertTrue(task.cancelled())
|
||||
self.assertEqual(record.walk_seq, seq) # no walk started after it
|
||||
self.assertEqual(self.scan.calls, 2)
|
||||
self.assertIsNone(record.flight)
|
||||
self.assertIsNone(record.rewalk_handle)
|
||||
self.assertEqual(self.api._listing_tasks, set())
|
||||
|
||||
Reference in New Issue
Block a user