From 115ceea74e11fcf2b7ad5717ef91980f501cc81b Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Sat, 28 Jun 2025 17:43:02 +0200 Subject: 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. --- syz-cluster/workflow/boot-step/main.go | 24 +++++++++++++++++------- 1 file 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{ -- cgit mrf-deployment