Skip to content

Commit cff086b

Browse files
committed
fix(processor): prevent panic in silence region test by using fatalf
Replace t.Errorf with t.Fatalf at line 692 in TestFindBestSilenceRegion_LateCandidateDiscoverable. The test checks that candidates is non-empty before indexing; using Errorf logs failure but continues to the unsafe access, causing a panic. Fatalf stops immediately with a clear message if the assertion fails. Signed-off-by: Martin Wimpress <code@wimpress.io>
1 parent 9cecb95 commit cff086b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/processor/analyzer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ func TestFindBestSilenceRegion_LateCandidateDiscoverable(t *testing.T) {
690690
t.Errorf("BestRegion.Start = %v, want 1800s", result.BestRegion.Start)
691691
}
692692
if len(result.Candidates) != 1 {
693-
t.Errorf("len(Candidates) = %d, want 1", len(result.Candidates))
693+
t.Fatalf("len(Candidates) = %d, want 1", len(result.Candidates))
694694
}
695695

696696
t.Logf("late candidate score=%.4f", result.Candidates[0].Score)

0 commit comments

Comments
 (0)