HH-833: fence gateway generations across replicas (#22)

This commit is contained in:
2026-08-29 23:27:30 +08:00
parent 9fc8e44123
commit 00d044d440
7 changed files with 83 additions and 27 deletions
+7 -7
View File
@@ -451,14 +451,14 @@ func TestPauseSerializesResumeAndRetainsClaimGateOnUnknownStop(t *testing.T) {
go func() { pauseDone <- do(app, http.MethodPost, "/api/phase-a/accounts/account-a/pause", "") }()
select {
case <-blocking.entered:
case <-time.After(time.Second):
case <-time.After(5 * time.Second):
t.Fatal("pause did not enter runtime stop")
}
go func() { resumeDone <- do(app, http.MethodPost, "/api/phase-a/accounts/account-a/resume", "") }()
select {
case response := <-resumeDone:
t.Fatalf("resume bypassed the runtime operation lock: %d", response.Code)
case <-time.After(50 * time.Millisecond):
case <-time.After(time.Second):
}
close(blocking.release)
if response := <-pauseDone; response.Code != http.StatusInternalServerError {
@@ -1890,7 +1890,7 @@ func TestPostgresRebindRecoversRealConcurrentRaces(t *testing.T) {
}()
select {
case <-deleteDone:
case <-time.After(time.Second):
case <-time.After(5 * time.Second):
close(releaseDelete)
t.Fatal("rebind did not reach the DELETE barrier")
}
@@ -3211,7 +3211,7 @@ func TestImageDisableWaitsForUpgradeCommit(t *testing.T) {
}()
select {
case <-gateway.createStarted:
case <-time.After(time.Second):
case <-time.After(5 * time.Second):
t.Fatal("upgrade did not reach gateway create")
}
@@ -3236,7 +3236,7 @@ func TestImageDisableWaitsForUpgradeCommit(t *testing.T) {
select {
case result := <-disableDone:
t.Fatalf("disable completed before upgrade commit: %#v", result)
case <-time.After(50 * time.Millisecond):
case <-time.After(time.Second):
}
close(releaseCreate)
@@ -3297,7 +3297,7 @@ func TestListAndHeartbeatWaitForUpgradeCoordination(t *testing.T) {
}()
select {
case <-gateway.createStarted:
case <-time.After(time.Second):
case <-time.After(5 * time.Second):
t.Fatal("upgrade did not reach gateway create")
}
@@ -3324,7 +3324,7 @@ func TestListAndHeartbeatWaitForUpgradeCoordination(t *testing.T) {
t.Fatalf("list reconciled a stale snapshot during upgrade: %#v", result)
case err := <-heartbeatDone:
t.Fatalf("heartbeat reconciled a stale snapshot during upgrade: %v", err)
case <-time.After(50 * time.Millisecond):
case <-time.After(time.Second):
}
close(releaseCreate)