From 77187656728a5d9458f5a7ba82fc4b9b2704e37f Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 23 Aug 2024 14:21:59 +0200 Subject: pkg/repro: don't exaggerate timeouts Our largest timeout is 6 minutes, so anything between 1.5 minutes and 6 ended up having a 9 minute timeout. That's too much. Consider the time it actually took to crash the kernel. --- pkg/instance/execprog.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'pkg/instance') diff --git a/pkg/instance/execprog.go b/pkg/instance/execprog.go index 6abf8fd9c..4ab5c09a7 100644 --- a/pkg/instance/execprog.go +++ b/pkg/instance/execprog.go @@ -36,8 +36,9 @@ type ExecProgInstance struct { } type RunResult struct { - Output []byte - Report *report.Report + Output []byte + Report *report.Report + Duration time.Duration } const ( @@ -99,6 +100,8 @@ func CreateExecProgInstance(vmPool *vm.Pool, vmIndex int, mgrCfg *mgrconfig.Conf func (inst *ExecProgInstance) runCommand(command string, duration time.Duration, exitCondition vm.ExitCondition) (*RunResult, error) { + start := time.Now() + var prefixOutput []byte if inst.StraceBin != "" { filterCalls := "" @@ -128,8 +131,11 @@ func (inst *ExecProgInstance) runCommand(command string, duration time.Duration, } inst.Logf(2, "program crashed: %v", rep.Title) } - result := &RunResult{append(prefixOutput, output...), rep} - return result, nil + return &RunResult{ + Output: append(prefixOutput, output...), + Report: rep, + Duration: time.Since(start), + }, nil } func (inst *ExecProgInstance) runBinary(bin string, duration time.Duration) (*RunResult, error) { -- cgit mrf-deployment