Generalize consumeSlow and add stop support

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
Upstream-commit: 417e48e4a00c891e8fe5614ac6a1ef12de951f72
Component: engine
This commit is contained in:
Tonis Tiigi
2014-10-30 21:11:33 +02:00
parent 55acba12a1
commit 4b66ac1426
2 changed files with 17 additions and 11 deletions
@@ -4,7 +4,6 @@ import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"net"
"os"
@@ -2462,7 +2461,7 @@ func TestRunSlowStdoutConsumer(t *testing.T) {
if err := c.Start(); err != nil {
t.Fatal(err)
}
n, err := consumeSlow(stdout, 10000, 5*time.Millisecond)
n, err := consumeWithSpeed(stdout, 10000, 5*time.Millisecond, nil)
if err != nil {
t.Fatal(err)
}