Skip to content

Commit 24ea202

Browse files
committed
fix test
1 parent 77261e1 commit 24ea202

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/config/config_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ func TestDefault(t *testing.T) {
2121
t.Errorf("MaxFileBytes = %v, want %v", cfg.MaxFileBytes, 2*1024*1024)
2222
}
2323

24-
if cfg.WorkerCount != runtime.NumCPU() {
25-
t.Errorf("WorkerCount = %v, want %v", cfg.WorkerCount, runtime.NumCPU())
24+
expectedWorkers := runtime.NumCPU() / 2
25+
if expectedWorkers < 1 {
26+
expectedWorkers = 1
27+
}
28+
if cfg.WorkerCount != expectedWorkers {
29+
t.Errorf("WorkerCount = %v, want %v", cfg.WorkerCount, expectedWorkers)
2630
}
2731

2832
if len(cfg.IndexPaths) == 0 {

0 commit comments

Comments
 (0)