R-1340 second producer: a restore_mixed hold's Why() names the cause from its record (found live on rc.1: the hub's Held apps line said off-site/database for a local restore with no database) — test red first
gates / gates (push) Successful in 30s
gates / gates (push) Successful in 30s
This commit is contained in:
1 parent
6077ac0083
commit
99fac06aa7
4 files changed
+80
-2
No files matched your search
@@ -0,0 +1,41 @@
|
||||
package settings
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// R-1340, second producer (found live 2026-10-29 on Tester 1): the hold's Why() — the hub's „Held apps" line and the
|
||||
// box's app_held event — still said „held after an off-site restore failed its database replay" for a LOCAL restore of
|
||||
// an app with no database whose put-back stop failed. It must name what the hold record carries.
|
||||
// RED-PROOF: seen failing on the old fixed sentence.
|
||||
func TestR1340_WhyNamesTheMixedCause(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
h RestoreHold
|
||||
want, not []string
|
||||
}{
|
||||
{"local put-back, no database", RestoreHold{Reason: HoldReasonRestoreMixed, At: "T", RestoreKind: RestoreKindLocal, MixedCause: MixedCausePutBack, FailedStep: "stopping the app before the put-back"},
|
||||
[]string{"local restore", "putting the live data back failed", "stopping the app before the put-back"}, []string{"database", "off-site"}},
|
||||
{"off-site database replay", RestoreHold{Reason: HoldReasonRestoreMixed, At: "T", RestoreKind: RestoreKindOffsite, MixedCause: MixedCausePutBack, DBReplay: true},
|
||||
[]string{"off-site restore", "database replay", "putting the live data back failed"}, nil},
|
||||
{"definition write", RestoreHold{Reason: HoldReasonRestoreMixed, At: "T", RestoreKind: RestoreKindOffsite, MixedCause: MixedCauseDefinitionWrite},
|
||||
[]string{"definition"}, []string{"database"}},
|
||||
{"interrupted put-back", RestoreHold{Reason: HoldReasonRestoreMixed, At: "T", MixedCause: MixedCauseInterruptedPutBack},
|
||||
[]string{"interrupted"}, []string{"database"}},
|
||||
{"legacy record", RestoreHold{Reason: HoldReasonRestoreMixed, At: "T"},
|
||||
[]string{"stopped half-way", "clear the hold"}, []string{"database", "off-site"}},
|
||||
} {
|
||||
got := tc.h.Why()
|
||||
for _, w := range tc.want {
|
||||
if !strings.Contains(got, w) {
|
||||
t.Errorf("%s: %q lacks %q", tc.name, got, w)
|
||||
}
|
||||
}
|
||||
for _, n := range tc.not {
|
||||
if strings.Contains(got, n) {
|
||||
t.Errorf("%s: %q says %q", tc.name, got, n)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user