diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-07-17 17:34:58 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-07-18 10:09:54 +0000 |
| commit | 1a24228b092c1d3e5beca18df0681b331b6e4878 (patch) | |
| tree | 42e124a85ff04bcb2a3d2ea0ddd468939ea3d4a4 /pkg | |
| parent | c517e6bc5f780f06798e6cfd0c82ca796eea57ab (diff) | |
pkg/manager: consider matched PCs in zero focused coverage test
If we matched 0 PCs for the areas of focused fuzzing, don't abort the
process after 30 minutes.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/manager/diff.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pkg/manager/diff.go b/pkg/manager/diff.go index 97515f8f0..c45c19fd5 100644 --- a/pkg/manager/diff.go +++ b/pkg/manager/diff.go @@ -272,8 +272,15 @@ func (dc *diffContext) monitorPatchedCoverage(ctx context.Context) error { // The feature is disabled. return nil } - if len(dc.new.cfg.Experimental.FocusAreas) < 2 { + focusPCs := 0 + // The last one is "everything else", so it's not of interest. + coverFilters := dc.new.coverFilters + for i := 0; i < len(coverFilters.Areas)-1; i++ { + focusPCs += len(coverFilters.Areas[i].CoverPCs) + } + if focusPCs == 0 { // No areas were configured. + log.Logf(1, "no PCs in the areas of focused fuzzing, skipping the zero patched coverage check") return nil } @@ -290,9 +297,6 @@ func (dc *diffContext) monitorPatchedCoverage(ctx context.Context) error { case <-ctx.Done(): return nil } - // Ideally, we should also consider whether the area of interest actually - // has any coverage points (e.g. mm/ mostly doesn't), but such patches are only - // a tiny minority among the actual changes to the code we cannot reach. focusAreaStats := dc.new.progsPerArea() if focusAreaStats[modifiedArea]+focusAreaStats[includesArea] > 0 { log.Logf(0, "fuzzer has reached the modified code (%d + %d), continuing fuzzing", |
