mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 11:07:31 +01:00
test: exercise absent HEAD maintenance diagnostics
This commit is contained in:
1 parent
15d5dc1ba5
commit
3570a483d0
1 file changed
+4
-1
@@ -29,7 +29,7 @@ type maintenanceDiagnosticFiler struct {
|
||||
func (f *maintenanceDiagnosticFiler) LookupEntry(ctx context.Context, dir, name string) (*filerpb.Entry, error) {
|
||||
if name == layout.HeadName && f.fail.Swap(false) {
|
||||
if f.absent {
|
||||
return nil, nil
|
||||
return nil, chunkstore.ErrNotFound
|
||||
}
|
||||
return nil, errors.New("diagnostic read unavailable")
|
||||
}
|
||||
@@ -251,6 +251,9 @@ func TestMaintenanceStatusRealPassAndTimeout(t *testing.T) {
|
||||
if last["error"] != "" || !strings.Contains(last["headGenError"].(string), "HEAD generation not read") {
|
||||
t.Fatalf("missing diagnostic: %v", last)
|
||||
}
|
||||
if kind == "head-absent" && last["headGenError"] != "HEAD generation not read: HEAD absent" {
|
||||
t.Fatalf("missing absent-HEAD diagnostic: %v", last)
|
||||
}
|
||||
} else if last["error"] != "" || last["headGenError"] != "" {
|
||||
t.Fatalf("unexpected error: %v", last)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user