diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-08-23 14:21:59 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-08-27 13:41:43 +0000 |
| commit | 77187656728a5d9458f5a7ba82fc4b9b2704e37f (patch) | |
| tree | 64668aa2f0a899d1eddf67e12324eb10d626bd29 /pkg/instance/execprog.go | |
| parent | d7ca24bcef5a225f0b4bd0ee404b5650f871e61b (diff) | |
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.
Diffstat (limited to 'pkg/instance/execprog.go')
| -rw-r--r-- | pkg/instance/execprog.go | 14 |
1 files changed, 10 insertions, 4 deletions
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) { |
