mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
Merge pull request #1429 from gtardif/fix_flaky_restart_test
Fix log expectation with random exec order
This commit is contained in:
commit
c2195b5cca
@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@ -139,10 +140,9 @@ func TestAttachRestart(t *testing.T) {
|
||||
res := c.RunDockerOrExitError("compose", "--ansi=never", "--project-directory", "fixtures/attach-restart", "up")
|
||||
output := res.Stdout()
|
||||
|
||||
assert.Assert(t, strings.Contains(output, `another_1 | world
|
||||
attach-restart_another_1 exited with code 1
|
||||
another_1 | world
|
||||
attach-restart_another_1 exited with code 1
|
||||
another_1 | world
|
||||
attach-restart_another_1 exited with code 1`), res.Combined())
|
||||
exitRegex := regexp.MustCompile("attach-restart_another_1 exited with code 1")
|
||||
assert.Equal(t, len(exitRegex.FindAllStringIndex(output, -1)), 3, res.Combined())
|
||||
|
||||
execRegex := regexp.MustCompile(`another_1 \| world`)
|
||||
assert.Equal(t, len(execRegex.FindAllStringIndex(output, -1)), 3, res.Combined())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user