Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/vectorindex/hnsw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ func TestHNSW_Recall10k(t *testing.T) {
if testing.Short() {
t.Skip("skipping 10k benchmark in -short")
}
if raceEnabled {
// Workload is fully sequential (no goroutines), so the race
// detector has nothing to catch here — it just adds ~10× overhead
// that dominates CI. Concurrency correctness is covered by
// TestHNSW_ConcurrentAddSearch, which DOES run under -race.
t.Skip("skipping 10k recall benchmark under -race (sequential workload)")
}
const (
n = 10_000
dim = 384
Expand Down
5 changes: 5 additions & 0 deletions internal/vectorindex/race_off.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//go:build !race

package vectorindex

const raceEnabled = false
10 changes: 10 additions & 0 deletions internal/vectorindex/race_on.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//go:build race

package vectorindex

// raceEnabled reports whether the package was compiled with -race.
// Some long-running deterministic benchmarks (e.g. TestHNSW_Recall10k)
// gain nothing from the race detector — they're sequential — and pay
// ~10× overhead that dominates CI time. Those tests skip when this is
// true, leaving the explicitly concurrent tests to exercise the detector.
const raceEnabled = true
Loading