From 17a70fdb2d9fc362abad31e3b92c9ee7f8c0243b Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Mon, 8 May 2023 19:56:10 +0000 Subject: [PATCH] Add option for timeout after starting of the qemu vm before tests --- pew.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pew.go b/pew.go index 0f11600..fcbba13 100644 --- a/pew.go +++ b/pew.go @@ -42,8 +42,9 @@ type PewCmd struct { ArtifactConfig string `help:"path to artifact config" type:"path"` - QemuTimeout time.Duration `help:"timeout for qemu"` - DockerTimeout time.Duration `help:"timeout for docker"` + QemuTimeout time.Duration `help:"timeout for qemu"` + QemuAfterStartTimeout time.Duration `help:"timeout after starting of the qemu vm before tests"` + DockerTimeout time.Duration `help:"timeout for docker"` Threshold float64 `help:"reliablity threshold for exit code" default:"1.00"` @@ -633,6 +634,9 @@ func (cmd PewCmd) testArtifact(swg *sizedwaitgroup.SizedWaitGroup, } defer q.Stop() + slog.Debug().Msgf("wait %v", cmd.QemuAfterStartTimeout) + time.Sleep(cmd.QemuAfterStartTimeout) + go func() { time.Sleep(time.Minute) for !q.Died {