mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-03 09:26:03 +00:00
test(operations): the stuck-host cancel test waits for both hosts' hooks
The worker starts the cancel hooks of the two hosts in no set order. The test waited only for the healthy host's hook and then counted the stuck host's, which on a slow runner had not started yet (seen on Python 3.14 in CI): it now waits for both before it counts.
This commit is contained in:
parent
bf08b6cfa5
commit
84248655e0
1 changed files with 2 additions and 1 deletions
|
|
@ -83,7 +83,8 @@ class WorkerTestCase(TransactionTestCase):
|
|||
for op in [*stuck, healthy]:
|
||||
jobs.cancel(op.pk, self.user)
|
||||
# the other host's cancel goes through; the stuck host's second cancel waits for its first
|
||||
self.assertTrue(wait_for(lambda: ("cancel", 2) in fakes.HOST_CALLS))
|
||||
# (the hooks start in no set order: wait for both)
|
||||
self.assertTrue(wait_for(lambda: ("cancel", 2) in fakes.HOST_CALLS and ("cancel", 1) in fakes.HOST_CALLS))
|
||||
self.assertEqual(fakes.HOST_CALLS.count(("cancel", 1)), 1)
|
||||
fakes.STUCK[1].set()
|
||||
self.assertTrue(wait_for(lambda: fakes.HOST_CALLS.count(("cancel", 1)) == 2))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue