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
+2 -2
View File
@@ -338,7 +338,7 @@ func TestNetworkExitBindingRuntimeAndAuditWorkflow(t *testing.T) {
if _, err := store.ActivateRuntime(ctx, env.Alias, "container-a", bound.BindingVersion+1, second.ID, "network-a"); !errors.Is(err, ErrConflict) {
t.Fatalf("stale binding metadata must not activate a runtime: %v", err)
}
if _, err := store.db.ExecContext(ctx, `UPDATE runtime_instance SET lease_until = now() + interval '1 second' WHERE id = $1`, active.RuntimeInstanceID); err != nil {
if _, err := store.db.ExecContext(ctx, `UPDATE runtime_instance SET lease_until = now() + interval '10 seconds' WHERE id = $1`, active.RuntimeInstanceID); err != nil {
t.Fatal(err)
}
if _, err := store.ActivateRuntime(ctx, env.Alias, "container-a", bound.BindingVersion, bound.Exit.ID, "network-a"); err != nil {
@@ -440,7 +440,7 @@ func TestNetworkExitBindingRuntimeAndAuditWorkflow(t *testing.T) {
select {
case err := <-activation:
t.Fatalf("activation bypassed the locked account row: %v", err)
case <-time.After(50 * time.Millisecond):
case <-time.After(time.Second):
}
if _, err := pauseTx.ExecContext(ctx, `UPDATE social_account SET status = 'paused' WHERE id = 'account-a'`); err != nil {
t.Fatal(err)