mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-07-09 16:00:59 +00:00
test: fix 60s hang in canonical store refresh test
TestMonitorPollGuestSnapshots_RefreshesStaleCanonicalStoreForClusterGuest passed context.Background() to pollGuestSnapshots, which creates an internal 60s snapshot timeout. The backupStorageTimeoutSnapshotClient mock blocks GetStorage until context cancellation, so the test wasted 60s waiting for the timeout to expire. Pass a 200ms deadline context so pollGuestSnapshots caps its budget down — test now runs in 0.2s instead of 60s and no longer times out under -race.
This commit is contained in:
parent
3773749281
commit
f3d9f426c5
1 changed files with 3 additions and 1 deletions
|
|
@ -225,7 +225,9 @@ func TestMonitorPollGuestSnapshots_RefreshesStaleCanonicalStoreForClusterGuest(t
|
|||
}},
|
||||
}
|
||||
|
||||
m.pollGuestSnapshots(context.Background(), "homelab", client)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 200*time.Millisecond)
|
||||
defer cancel()
|
||||
m.pollGuestSnapshots(ctx, "homelab", client)
|
||||
|
||||
if client.snapshotCalls == 0 {
|
||||
t.Fatal("expected guest snapshot polling to use fresh clustered guest state")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue