diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-08-05 21:52:15 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-08-06 09:55:41 +0000 |
| commit | 745510422fa0fd508f681b06c98e3a74d41344c5 (patch) | |
| tree | aa2563d9870e90c081bd481a7046b5bc2964bd77 /pkg | |
| parent | 5ba0fed13435213276f29e3d9e39d926f04ac1a8 (diff) | |
pkg/manager: fix a NeedRepro check
It's been checking the inverse of what was needed.
Rename the helper function to reduce confusion in the future.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/manager/diff.go | 10 | ||||
| -rw-r--r-- | pkg/manager/diff_test.go | 16 |
2 files changed, 13 insertions, 13 deletions
diff --git a/pkg/manager/diff.go b/pkg/manager/diff.go index ae05f7a97..c88e88903 100644 --- a/pkg/manager/diff.go +++ b/pkg/manager/diff.go @@ -323,23 +323,23 @@ func (dc *diffContext) monitorPatchedCoverage(ctx context.Context) error { // TODO: instead of this limit, consider expotentially growing delays between reproduction attempts. const maxReproAttempts = 6 -func skipDiffRepro(title string) bool { +func needReproForTitle(title string) bool { if strings.Contains(title, "no output") || strings.Contains(title, "lost connection") || strings.Contains(title, "detected stall") || strings.Contains(title, "SYZ") { // Don't waste time reproducing these. - return true + return false } - return false + return true } func (dc *diffContext) NeedRepro(crash *Crash) bool { if crash.FullRepro { return true } - if skipDiffRepro(crash.Title) { - return true + if !needReproForTitle(crash.Title) { + return false } dc.mu.Lock() defer dc.mu.Unlock() diff --git a/pkg/manager/diff_test.go b/pkg/manager/diff_test.go index 454a92831..9c17361d5 100644 --- a/pkg/manager/diff_test.go +++ b/pkg/manager/diff_test.go @@ -108,15 +108,15 @@ func TestModifiedSymbols(t *testing.T) { }) } -func TestSkipDiffRepro(t *testing.T) { +func TestNeedReproForTitle(t *testing.T) { for title, skip := range map[string]bool{ - "no output from test machine": true, - "SYZFAIL: read failed": true, - "lost connection to test machine": true, - "INFO: rcu detected stall in clone": true, - "WARNING in arch_install_hw_breakpoint": false, - "KASAN: slab-out-of-bounds Write in __bpf_get_stackid": false, + "no output from test machine": false, + "SYZFAIL: read failed": false, + "lost connection to test machine": false, + "INFO: rcu detected stall in clone": false, + "WARNING in arch_install_hw_breakpoint": true, + "KASAN: slab-out-of-bounds Write in __bpf_get_stackid": true, } { - assert.Equal(t, skip, skipDiffRepro(title), "title=%q", title) + assert.Equal(t, skip, needReproForTitle(title), "title=%q", title) } } |
