This repository was archived by the owner on Sep 9, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ type monitoredCmd struct {
26
26
stderr * activityBuffer
27
27
}
28
28
29
- // timeoutError indicates that the monitored process was terminated due to
30
- // exceeding activity timeouts .
31
- type timeoutError struct {
29
+ // noProgressError indicates that the monitored process was terminated due to
30
+ // exceeding exceeding the progress timeout .
31
+ type noProgressError struct {
32
32
timeout time.Duration
33
33
}
34
34
@@ -92,7 +92,7 @@ selloop:
92
92
if err := killProcess (c .cmd , isDone ); err != nil {
93
93
killerr = & killCmdError {err }
94
94
} else {
95
- killerr = & timeoutError {c .timeout }
95
+ killerr = & noProgressError {c .timeout }
96
96
}
97
97
break selloop
98
98
}
@@ -161,7 +161,7 @@ func (b *activityBuffer) lastActivity() time.Time {
161
161
return b .lastActivityStamp
162
162
}
163
163
164
- func (e timeoutError ) Error () string {
164
+ func (e noProgressError ) Error () string {
165
165
return fmt .Sprintf ("command killed after %s of no activity" , e .timeout )
166
166
}
167
167
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import (
16
16
func mkTestCmd (iterations int ) * monitoredCmd {
17
17
return newMonitoredCmd (
18
18
exec .Command ("./echosleep" , "-n" , fmt .Sprint (iterations )),
19
- 500 * time .Millisecond ,
19
+ 490 * time .Millisecond ,
20
20
)
21
21
}
22
22
@@ -49,7 +49,7 @@ func TestMonitoredCmd(t *testing.T) {
49
49
t .Error ("Expected command to fail" )
50
50
}
51
51
52
- _ , ok := err .(* timeoutError )
52
+ _ , ok := err .(* noProgressError )
53
53
if ! ok {
54
54
t .Errorf ("Expected a timeout error, but got: %s" , err )
55
55
}
You can’t perform that action at this time.
0 commit comments