pkg/repro: fix no output timeout

We duplicated the no output timeout in the repro package,
and it got out of sync. It's not 3 mins now, but 5 mins.
Remove the duplication and fix this.
This commit is contained in:
Dmitry Vyukov 2019-05-20 18:53:12 +02:00
parent 2c9280d432
commit 32ebe81cf3
3 changed files with 6 additions and 6 deletions

View File

@ -254,9 +254,9 @@ func (ctx *context) extractProg(entries []*prog.LogEntry) (*Result, error) {
} }
// The shortest duration is 10 seconds to detect simple crashes (i.e. no races and no hangs). // The shortest duration is 10 seconds to detect simple crashes (i.e. no races and no hangs).
// The longest duration is 5 minutes to catch races and hangs. Note that this value must be larger // The longest duration is 6 minutes to catch races and hangs. Note that this value must be larger
// than hang/no output detection duration in vm.MonitorExecution, which is currently set to 3 mins. // than hang/no output detection duration in vm.MonitorExecution, which is currently set to 5 mins.
timeouts := []time.Duration{10 * time.Second, 1 * time.Minute, 5 * time.Minute} timeouts := []time.Duration{10 * time.Second, 1 * time.Minute, vm.NoOutputTimeout + time.Minute}
for _, timeout := range timeouts { for _, timeout := range timeouts {
// Execute each program separately to detect simple crashes caused by a single program. // Execute each program separately to detect simple crashes caused by a single program.

View File

@ -225,7 +225,7 @@ func (inst *Instance) MonitorExecution(outc <-chan []byte, errc <-chan error,
// in 140-280s detection delay. // in 140-280s detection delay.
// So the current timeout is 5 mins (300s). // So the current timeout is 5 mins (300s).
// We don't want it to be too long too because it will waste time on real hangs. // We don't want it to be too long too because it will waste time on real hangs.
if time.Since(lastExecuteTime) < noOutputTimeout { if time.Since(lastExecuteTime) < NoOutputTimeout {
break break
} }
diag, wait := inst.Diagnose() diag, wait := inst.Diagnose()
@ -347,7 +347,7 @@ var (
beforeContext = 1024 << 10 beforeContext = 1024 << 10
afterContext = 128 << 10 afterContext = 128 << 10
NoOutputTimeout = 5 * time.Minute
tickerPeriod = 10 * time.Second tickerPeriod = 10 * time.Second
noOutputTimeout = 5 * time.Minute
waitForOutputTimeout = 10 * time.Second waitForOutputTimeout = 10 * time.Second
) )

View File

@ -72,7 +72,7 @@ func (inst *testInstance) Close() {
func init() { func init() {
beforeContext = 200 beforeContext = 200
tickerPeriod = 1 * time.Second tickerPeriod = 1 * time.Second
noOutputTimeout = 5 * time.Second NoOutputTimeout = 5 * time.Second
waitForOutputTimeout = 3 * time.Second waitForOutputTimeout = 3 * time.Second
ctor := func(env *vmimpl.Env) (vmimpl.Pool, error) { ctor := func(env *vmimpl.Env) (vmimpl.Pool, error) {