host test: 30s deadlock bound in the launch verifier test (#851)
TestPlan14LaunchVerifierCallerOrder gave the caller 2 s after release. The guard-close and guard-rollback callers create and migrate a SQLite registry in that window, which on a CI worker's shared disk took longer than 2 s, failing the gate on every branch and on main. The bound detects a deadlock, which never finishes, so it is now 30 s. Squashed from ci-host-deadlock-bound-851 into main.
1 file changed,
+11
−2
internal/host/plan14_launch_verifier_test.go+11 −2
CI passed — run details
diff --git a/internal/host/plan14_launch_verifier_test.go b/internal/host/plan14_launch_verifier_test.go| index 36fe2e445..2e0ffa7a6 100644 |
| --- a/internal/host/plan14_launch_verifier_test.go |
| +++ b/internal/host/plan14_launch_verifier_test.go |
| @@ -52,6 +52,15 @@ func TestPlan14LaunchVerifierToken(t *testing.T) { |
| } |
| } |
| +// launchVerifierDeadlockBound is how long TestPlan14LaunchVerifierCallerOrder |
| +// waits for the holder, then the caller, after the release is let go. It |
| +// detects a deadlock, which never finishes, so it is far above any honest |
| +// latency: the guard-close and guard-rollback callers create and migrate a |
| +// SQLite registry in that window, about 16 ms on a RAM disk and 58 ms on an |
| +// NVMe disk, and past the old 2 s bound on a CI worker whose disk the |
| +// shard's parallel tests share (discussion #851). |
| +const launchVerifierDeadlockBound = 30 * time.Second |
| + |
| func TestPlan14LaunchVerifierCallerOrder(t *testing.T) { |
| t.Parallel() |
| for _, name := range []string{"idle", "begin", "end", "recover", "activation", "floor-begin", "floor-end", "system-begin", "system-clear", "system-recovery", "guard-close", "guard-rollback"} { |
| @@ -152,7 +161,7 @@ func TestPlan14LaunchVerifierCallerOrder(t *testing.T) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - case <-time.After(2 * time.Second): |
| + case <-time.After(launchVerifierDeadlockBound): |
| t.Fatal("release holder deadlocked") |
| } |
| select { |
| @@ -160,7 +169,7 @@ func TestPlan14LaunchVerifierCallerOrder(t *testing.T) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - case <-time.After(2 * time.Second): |
| + case <-time.After(launchVerifierDeadlockBound): |
| t.Fatal("caller deadlocked") |
| } |
| if verified == 0 { |