File tree 3 files changed +16
-7
lines changed
3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,16 @@ func (c *DockerContainer) StopLogProduction() error {
165
165
166
166
c .logProductionWaitGroup .Wait ()
167
167
168
- return <- c .logProductionError
168
+ if err := <- c .logProductionError ; err != nil {
169
+ if errors .Is (err , context .DeadlineExceeded ) || errors .Is (err , context .Canceled ) {
170
+ // Returning context errors is not useful for the consumer.
171
+ return nil
172
+ }
173
+
174
+ return err
175
+ }
176
+
177
+ return nil
169
178
}
170
179
171
180
func (c * DockerContainer ) WithLogProductionTimeout (timeout time.Duration ) {
Original file line number Diff line number Diff line change @@ -17,15 +17,15 @@ var defaultReadinessHook = func() LifecycleHooks {
17
17
func (ctx context.Context , c StartedContainer ) error {
18
18
// wait until all the exposed ports are mapped:
19
19
// it will be ready when all the exposed ports are mapped,
20
- // checking every 50ms, up to 5s , and failing if all the
21
- // exposed ports are not mapped in that time .
20
+ // checking every 50ms, up to 1s , and failing if all the
21
+ // exposed ports are not mapped in 5s .
22
22
dockerContainer := c .(* DockerContainer )
23
23
24
24
b := backoff .NewExponentialBackOff ()
25
25
26
26
b .InitialInterval = 50 * time .Millisecond
27
- b .MaxElapsedTime = 1 * time .Second
28
- b .MaxInterval = 5 * time . Second
27
+ b .MaxElapsedTime = 5 * time .Second
28
+ b .MaxInterval = time . Duration ( float64 ( time . Second ) * backoff . DefaultRandomizationFactor )
29
29
30
30
err := backoff .RetryNotify (
31
31
func () error {
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ func TestReaperReusedIfHealthy(t *testing.T) {
210
210
t .Skip ("Ryuk is disabled, skipping test" )
211
211
}
212
212
213
- SkipIfContainerRuntimeIsNotHealthy (& testing. T {} )
213
+ SkipIfContainerRuntimeIsNotHealthy (t )
214
214
215
215
ctx := context .Background ()
216
216
@@ -240,7 +240,7 @@ func TestRecreateReaperIfTerminated(t *testing.T) {
240
240
t .Skip ("Ryuk is disabled, skipping test" )
241
241
}
242
242
243
- SkipIfContainerRuntimeIsNotHealthy (& testing. T {} )
243
+ SkipIfContainerRuntimeIsNotHealthy (t )
244
244
245
245
ctx := context .Background ()
246
246
You can’t perform that action at this time.
0 commit comments