diff --git a/toxics/timeout.go b/toxics/timeout.go index f42d9d23..d05ca6f4 100644 --- a/toxics/timeout.go +++ b/toxics/timeout.go @@ -19,7 +19,11 @@ func (t *TimeoutToxic) Pipe(stub *ToxicStub) { return case <-stub.Interrupt: return - case <-stub.Input: + case c := <-stub.Input: + if c == nil { + stub.Close() + return + } // Drop the data on the ground. } } @@ -28,7 +32,11 @@ func (t *TimeoutToxic) Pipe(stub *ToxicStub) { select { case <-stub.Interrupt: return - case <-stub.Input: + case c := <-stub.Input: + if c == nil { + stub.Close() + return + } // Drop the data on the ground. } }