Correct CPU core counts and report incomplete data size scans
This commit is contained in:
@@ -53,3 +53,14 @@ func TestBoundedSizeSkipsSymlinks(t *testing.T) {
|
||||
t.Fatalf("size=%d, want 4", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBoundedSizeReportsIncompleteWalk(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
if _, err := boundedSize(ctx, t.TempDir(), nil); err != context.Canceled {
|
||||
t.Fatalf("cancelled size walk error = %v", err)
|
||||
}
|
||||
if _, err := boundedSize(context.Background(), filepath.Join(t.TempDir(), "missing"), nil); err == nil {
|
||||
t.Fatal("missing root must report a partial/unavailable size")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user