aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-06-28 17:43:02 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-07-02 19:05:30 +0000
commit115ceea74e11fcf2b7ad5717ef91980f501cc81b (patch)
treeea465da0496275379cf50c860cd0f1bf395f299e
parent0cd59a8f39893a99b3c21e8be52a1924e565581c (diff)
syz-cluster/workflow/boot-step: retry before failing
Retry the boot test up to 3 times before letting it fail and reporting the failure as a finding. That should make sure there are fewer false positives amoung the "boot error" and "test error" bugs.
-rw-r--r--syz-cluster/workflow/boot-step/main.go24
1 files changed, 17 insertions, 7 deletions
diff --git a/syz-cluster/workflow/boot-step/main.go b/syz-cluster/workflow/boot-step/main.go
index d88202034..2b180098b 100644
--- a/syz-cluster/workflow/boot-step/main.go
+++ b/syz-cluster/workflow/boot-step/main.go
@@ -13,6 +13,7 @@ import (
"github.com/google/syzkaller/pkg/instance"
"github.com/google/syzkaller/pkg/mgrconfig"
"github.com/google/syzkaller/pkg/osutil"
+ "github.com/google/syzkaller/pkg/report"
"github.com/google/syzkaller/syz-cluster/pkg/api"
"github.com/google/syzkaller/syz-cluster/pkg/app"
)
@@ -71,20 +72,29 @@ func main() {
}
}
+// To prevent false positive results, demand that in order to be marked as FAILED,
+// the test must fail 3 times in a row.
+const retryCount = 3
+
func runTest(ctx context.Context, client *api.Client) (bool, error) {
cfg, err := mgrconfig.LoadFile(filepath.Join("/configs", *flagConfig, "base.cfg"))
if err != nil {
return false, err
}
cfg.Workdir = "/tmp/test-workdir"
- rep, err := instance.RunSmokeTest(cfg)
- if err != nil {
- return false, err
- } else if rep == nil {
- return true, nil
- }
- log.Printf("found: %q", rep.Title)
+ var rep *report.Report
+ for i := 0; i < retryCount; i++ {
+ log.Printf("starting attempt #%d", i)
+ var err error
+ rep, err = instance.RunSmokeTest(cfg)
+ if err != nil {
+ return false, err
+ } else if rep == nil {
+ return true, nil
+ }
+ log.Printf("attempt failed: %q", rep.Title)
+ }
if *flagFindings {
log.Printf("reporting the finding")
findingErr := client.UploadFinding(ctx, &api.NewFinding{