From 3e8f9cea1b2feb873fbad88a55ae8091e0c09e84 Mon Sep 17 00:00:00 2001 From: Grigory Bazilevich Date: Thu, 12 Mar 2026 10:58:42 +0300 Subject: syz-ci: add syzkaller test timeout retrieval from config The timeout for "go test ..." can now be specified in the syz-ci settings in the `SyzkallerBuildParams` dictionary under `test_timeout`. Signed-off-by: Grigory Bazilevich --- pkg/updater/updater.go | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/updater/updater.go b/pkg/updater/updater.go index fc575a004..7251761cc 100644 --- a/pkg/updater/updater.go +++ b/pkg/updater/updater.go @@ -4,6 +4,7 @@ package updater import ( + "encoding/json" "fmt" "os" "path/filepath" @@ -56,6 +57,7 @@ type Config struct { SyzkallerBranch string SyzkallerDescriptions string SyzkallerRebuildPeriod int + SyzkallerBuildParams json.RawMessage Targets map[Target]bool MakeTargets []string // host make targets to build besides the targets-specific ones } @@ -301,7 +303,11 @@ func (upd *Updater) build(commit *vcs.Commit) error { return fmt.Errorf("make target failed: %w", err) } } - cmd = osutil.Command("go", "test", "-short", "./...") + test_timeout, err := parseTestTimeout(upd.cfg.SyzkallerBuildParams) + if err != nil { + return err + } + cmd = osutil.Command("go", "test", "-timeout", test_timeout, "-short", "./...") cmd.Dir = upd.syzkallerDir cmd.Env = append([]string{ "GOPATH=" + upd.gopathDir, @@ -320,6 +326,23 @@ func (upd *Updater) build(commit *vcs.Commit) error { return nil } +func parseTestTimeout(build json.RawMessage) (string, error) { + var to struct { + Timeout string `json:"test_timeout,omitempty"` + } + + to.Timeout = "20m" // default - 20 minutes + + if build != nil { + err := json.Unmarshal(build, &to) + if err != nil { + return "", err + } + } + + return to.Timeout, nil +} + // checkLatest returns tag of the latest build, // or an empty string if latest build is missing/broken. func (upd *Updater) checkLatest() string { -- cgit mrf-deployment