From 384d85dd910a3ea69eb9261a4495c2bbea8d5325 Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Mon, 26 Oct 2026 12:58:45 -0700 Subject: [PATCH] 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. --- tests/test_api_images.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_api_images.py b/tests/test_api_images.py index 40d5861d..ad27ba3c 100644 --- a/tests/test_api_images.py +++ b/tests/test_api_images.py @@ -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())