test: disk full: each filed defect (#484 #485 #486) is a known-finding row, strict once removed from the list

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-11-23 02:33:37 -08:00
1 parent 2de49cf295
commit 4f3fcb36e8
1 file changed
+29 -11
@@ -33,8 +33,10 @@ import (
// 3. The --host-limit-dir disk is full: the limiter fails open (the cut
// commits) and detach --plain still seals; guest I/O works meanwhile.
//
// A FINDING (a wrong error class, a limiter that does not fail open) fails
// the test with t.Errorf and the run continues to the end.
// Each filed defect is a known-finding row (diskFullFinding): while it
// reproduces the row logs KNOWN FINDING #n and passes; once fixed it logs
// FIXED #n; removing the issue from knownDiskFullFindings makes the row a
// strict assertion. A defect not in the list fails the test.
//
// Environment: SWBLOCK_DISKFULL_ROOT and SWBLOCK_DISKFULL_LIMIT (two mounted
// filesystems, nothing else on them); CHUNKSTORE_WEED; optional
@@ -131,9 +133,12 @@ func TestProcedureLocalDiskFull(t *testing.T) {
case firstErr == nil:
t.Logf("case 1: no error in %d writes with 2 MiB free", next)
case strings.Contains(firstErr.Error(), "status 0x800c"):
diskFullFinding(t, 484, false, "case 1: the guest saw the permanent 0x800c for ENOSPC")
case strings.Contains(firstErr.Error(), "status 0x0104"):
if holder.has("no space left on device") {
t.Errorf("FINDING case 1: the guest saw retryable 0x0104 (%v) while the holder logs ENOSPC: a permanent cause surfaced as retryable", firstErr)
diskFullFinding(t, 484, true, "case 1: the guest saw retryable 0x0104 (%v) while the holder logs ENOSPC: a permanent cause surfaced as retryable", firstErr)
} else {
diskFullFinding(t, 484, false, "case 1: 0x0104 with no ENOSPC behind it")
}
default:
t.Fatalf("case 1: the guest saw %v, not a documented completion for a full disk", firstErr)
@@ -308,17 +313,12 @@ func TestProcedureLocalDiskFull(t *testing.T) {
// INV-HOST-LAUNCH-CHECK-001, only reads it). The position for the ruling:
// the limiter paces background cuts and must fail open, so the cut
// commits; a refusal is reported for a ruling, not accepted.
if g := headGen(); r.rc != 0 || g <= g0 {
t.Errorf("FINDING case 3: with the host-limit dir full the cut exited %d and HEAD is at gen %d (was %d); the limiter did not fail open:\n%s", r.rc, g, g0, r.out)
}
g := headGen()
diskFullFinding(t, 485, r.rc != 0 || g <= g0, "case 3: with the host-limit dir full the cut exited %d and HEAD is at gen %d (was %d); the limiter did not fail open:\n%s", r.rc, g, g0, r.out)
t.Logf("case 3: cut with the host-limit dir full exited %d; guest write+flush succeeded meanwhile", r.rc)
// The seal of a planned hand-over must not depend on the limit directory.
out, errOut, rc := env.h.run(t, "ops", "chunk", "detach", "--plain", "--volume", "v1", "--status-addr", env.hosts["s1"].status, "--timeout", "120s")
if rc != 0 {
t.Errorf("FINDING case 3: detach --plain with the host-limit dir full exited %d:\n%s\n%s", rc, out, errOut)
} else {
t.Logf("case 3: detach --plain with the host-limit dir full sealed the volume")
}
diskFullFinding(t, 486, rc != 0, "case 3: detach --plain with the host-limit dir full exited %d:\n%s\n%s", rc, out, errOut)
fill.free(t)
t.Logf("slowest guest command answer: %s (bound %s)", diskFullSlowest, diskFullBound)
if !t.Failed() {
@@ -326,6 +326,24 @@ func TestProcedureLocalDiskFull(t *testing.T) {
}
}
// knownDiskFullFindings are the filed defects this test still expects.
var knownDiskFullFindings = map[int]bool{484: true, 485: true, 486: true}
// diskFullFinding is one defect row: bad reports whether issue's defect
// reproduced in this run.
func diskFullFinding(t *testing.T, issue int, bad bool, format string, args ...any) {
t.Helper()
msg := fmt.Sprintf(format, args...)
switch {
case bad && knownDiskFullFindings[issue]:
t.Logf("KNOWN FINDING #%d: %s", issue, msg)
case bad:
t.Errorf("FINDING #%d: %s", issue, msg)
case knownDiskFullFindings[issue]:
t.Logf("FIXED #%d: no longer reproduces; remove it from knownDiskFullFindings so this row is strict", issue)
}
}
var (
errDiskFullHang = errors.New("no answer within the bound")
diskFullSlowest time.Duration