mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 19:17:28 +01:00
seaweed-block: a rack outage measurement records every step
Steps 4 to 7 report a contradiction with t.Errorf instead of stopping, so one step that disagrees with the model still leaves the later steps and the final HEAD check measured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
87c933c43e
commit
f3755af25e
1 file changed
+9
-9
@@ -156,10 +156,10 @@ func TestE9RackOutageOnAReleasedStore(t *testing.T) {
|
||||
t.Logf("E9-OUTAGE step 4 cut window=%s: HTTP %d code=%q retryable=%v after %s (outage age %s): %s; snapshots before=%s after=%s",
|
||||
e9Window, cut.status, cut.code, cut.retryable, cut.at.Round(time.Millisecond), time.Since(downAt).Round(time.Second), firstLine(cut.message), snaps4, snapList())
|
||||
if cut.status == http.StatusOK {
|
||||
t.Fatalf("step 4: a cut succeeded while no 020 placement can be written (HEAD gen %v)", cut.headGen)
|
||||
t.Errorf("step 4: a cut succeeded while no 020 placement can be written (HEAD gen %v)", cut.headGen)
|
||||
}
|
||||
if cut.status == 0 {
|
||||
t.Fatalf("step 4: the cut gave no typed answer within %s", e9AnswerBound)
|
||||
t.Errorf("step 4: the cut gave no typed answer within %s", e9AnswerBound)
|
||||
}
|
||||
|
||||
// 5. A snapshot during the outage.
|
||||
@@ -168,10 +168,10 @@ func TestE9RackOutageOnAReleasedStore(t *testing.T) {
|
||||
t.Logf("E9-OUTAGE step 5 snapshot: HTTP %d code=%q state=%q after %s (outage age %s): %s; snapshots before=%s after=%s",
|
||||
snap.status, snap.code, snap.state, snap.at.Round(time.Millisecond), time.Since(downAt).Round(time.Second), firstLine(snap.message), snaps5, snapList())
|
||||
if snap.status == http.StatusOK {
|
||||
t.Fatalf("step 5: a snapshot succeeded while no 020 placement can be written")
|
||||
t.Errorf("step 5: a snapshot succeeded while no 020 placement can be written")
|
||||
}
|
||||
if snap.status == 0 {
|
||||
t.Fatalf("step 5: the snapshot gave no typed answer within %s (state %q)", e9AnswerBound, snap.state)
|
||||
t.Errorf("step 5: the snapshot gave no typed answer within %s (state %q)", e9AnswerBound, snap.state)
|
||||
}
|
||||
|
||||
// 6. A restore of the pre-outage snapshot into a new volume during the
|
||||
@@ -181,10 +181,10 @@ func TestE9RackOutageOnAReleasedStore(t *testing.T) {
|
||||
t.Logf("E9-OUTAGE step 6 restore %s -> v2: exit %d code=%q retryable=%v after %s (outage age %s): %s; snapshots before=%s after=%s",
|
||||
baseSnap, restore.exit, restore.code, restore.retryable, restore.at.Round(time.Millisecond), time.Since(downAt).Round(time.Second), firstLine(restore.message), snaps6, snapList())
|
||||
if restore.exit == 0 {
|
||||
t.Fatalf("step 6: a restore succeeded while no 020 placement can be written: %s", restore.message)
|
||||
t.Errorf("step 6: a restore succeeded while no 020 placement can be written: %s", restore.message)
|
||||
}
|
||||
if restore.exit < 0 {
|
||||
t.Fatalf("step 6: the restore gave no answer within %s: %s", e9AnswerBound, restore.message)
|
||||
t.Errorf("step 6: the restore gave no answer within %s: %s", e9AnswerBound, restore.message)
|
||||
}
|
||||
|
||||
// 7. A plain detach during the outage, last.
|
||||
@@ -194,11 +194,11 @@ func TestE9RackOutageOnAReleasedStore(t *testing.T) {
|
||||
e9Window, detach.status, detach.code, detach.retryable, detach.at.Round(time.Millisecond), firstLine(detach.message), snaps7, snapList())
|
||||
switch {
|
||||
case detach.status == http.StatusOK:
|
||||
t.Fatalf("step 7: a plain detach succeeded while no 020 placement can be written (HEAD gen %v)", detach.headGen)
|
||||
t.Errorf("step 7: a plain detach succeeded while no 020 placement can be written (HEAD gen %v)", detach.headGen)
|
||||
case detach.status == 0:
|
||||
t.Fatalf("step 7: the plain detach gave no typed answer within %s", e9AnswerBound)
|
||||
t.Errorf("step 7: the plain detach gave no typed answer within %s", e9AnswerBound)
|
||||
case detach.code != "detach_aborted" && detach.code != "outcome_unknown" && detach.code != "plain_detach_busy":
|
||||
t.Fatalf("step 7: the plain detach answered HTTP %d %q, not a typed detach answer (detach_aborted, outcome_unknown, plain_detach_busy)", detach.status, detach.code)
|
||||
t.Errorf("step 7: the plain detach answered HTTP %d %q, not a typed detach answer (detach_aborted, outcome_unknown, plain_detach_busy)", detach.status, detach.code)
|
||||
}
|
||||
|
||||
// 8. HEAD's committed image is the baseline's and the pre-outage
|
||||
|
||||
Reference in new issue
Block a user