diff options
| author | Grigory Bazilevich <g.bazilevich@ispras.ru> | 2026-03-12 10:58:42 +0300 |
|---|---|---|
| committer | Grigory Bazilevich <g.bazilevich@ispras.ru> | 2026-03-12 11:30:09 +0300 |
| commit | 3e8f9cea1b2feb873fbad88a55ae8091e0c09e84 (patch) | |
| tree | 5bc81ee9c10cf77e308e3d2be197adce11f951b6 /pkg | |
| parent | 6b082d1d2457077813cba8d903ab6a062ad3a21a (diff) | |
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 <g.bazilevich@ispras.ru>
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/updater/updater.go | 25 |
1 files changed, 24 insertions, 1 deletions
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 { |
