From 916acc9895b93e7b1aa4675397dc384a633e8a86 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Tue, 30 May 2023 20:52:41 +0000 Subject: [PATCH] feat: add timeout for first threads --- pew.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pew.go b/pew.go index 32c9d48..d991ee7 100644 --- a/pew.go +++ b/pew.go @@ -839,6 +839,8 @@ func (cmd PewCmd) performCI(ka config.Artifact) (err error) { found := false max := cmd.Max + qemuCounter := 0 + swg := sizedwaitgroup.New(cmd.Threads) if cmd.Shuffle { cmd.kcfg.Kernels = shuffleKernels(cmd.kcfg.Kernels) @@ -864,6 +866,11 @@ func (cmd PewCmd) performCI(ka config.Artifact) (err error) { break } swg.Add() + if qemuCounter < cmd.Threads { + duration := time.Second * time.Duration(qemuCounter) + time.Sleep(duration) + qemuCounter++ + } go cmd.testArtifact(&swg, ka, kernel) } }