mirror of https://github.com/docker/compose.git
Fix log expectation with random exec order
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
This commit is contained in:
parent
30e2d1d360
commit
e2d92ece50
|
@ -20,6 +20,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
@ -139,10 +140,9 @@ func TestAttachRestart(t *testing.T) {
|
||||||
res := c.RunDockerOrExitError("compose", "--ansi=never", "--project-directory", "fixtures/attach-restart", "up")
|
res := c.RunDockerOrExitError("compose", "--ansi=never", "--project-directory", "fixtures/attach-restart", "up")
|
||||||
output := res.Stdout()
|
output := res.Stdout()
|
||||||
|
|
||||||
assert.Assert(t, strings.Contains(output, `another_1 | world
|
exitRegex := regexp.MustCompile("attach-restart_another_1 exited with code 1")
|
||||||
attach-restart_another_1 exited with code 1
|
assert.Equal(t, len(exitRegex.FindAllStringIndex(output, -1)), 3, res.Combined())
|
||||||
another_1 | world
|
|
||||||
attach-restart_another_1 exited with code 1
|
execRegex := regexp.MustCompile(`another_1 \| world`)
|
||||||
another_1 | world
|
assert.Equal(t, len(execRegex.FindAllStringIndex(output, -1)), 3, res.Combined())
|
||||||
attach-restart_another_1 exited with code 1`), res.Combined())
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue