test: preserve the missing-filer refusal control

This commit is contained in:
pingqiu committed 2026-11-29 10:42:20 -08:00
1 parent ba524999fb
commit 30b99055ac
1 file changed
+5 -2
@@ -56,7 +56,7 @@ func TestWALStoreChunkFlags(t *testing.T) {
t.Fatalf("walstore with the chunk defaults untouched: %v", err)
}
refused := map[string][]string{
"no filer": base("--durable-root=/tmp/sw-block", "--durable-impl=walstore-chunk"),
"no filer": base("--durable-root=/tmp/sw-block", "--durable-impl=walstore-chunk", "--workspace-lease"),
"no durable root": base("--durable-impl=walstore-chunk", "--workspace-lease", "--chunk-filer=127.0.0.1:18888"),
"relative path": base("--durable-root=/tmp/sw-block", "--durable-impl=walstore-chunk", "--workspace-lease", "--chunk-filer=x:1", "--chunk-path=swblock"),
"root path": base("--durable-root=/tmp/sw-block", "--durable-impl=walstore-chunk", "--workspace-lease", "--chunk-filer=x:1", "--chunk-path=/"),
@@ -75,8 +75,11 @@ func TestWALStoreChunkFlags(t *testing.T) {
"interval on walstore": base("--durable-root=/tmp/sw-block", "--durable-impl=walstore", "--chunk-capture-interval=5s"),
}
for name, args := range refused {
if _, err := parseFlags(args); err == nil {
_, err := parseFlags(args)
if err == nil {
t.Errorf("%s: parseFlags succeeded; want an error", name)
} else if name == "no filer" && !strings.Contains(err.Error(), "requires --chunk-filer") {
t.Errorf("missing filer refused for wrong reason: %v", err)
}
}
}