Skip to content

Commit a99a0b5

Browse files
authored
Merge pull request docker#10320 from milas/e2e-win-pause
test: tweak pause test to try and prevent failures in Windows CI
2 parents af414e9 + e31b95c commit a99a0b5

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

pkg/e2e/fixtures/pause/compose.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ services:
22
a:
33
image: nginx:alpine
44
ports: [80]
5+
healthcheck:
6+
test: wget --spider -S -T1 http://localhost:80
7+
interval: 1s
8+
timeout: 1s
59
b:
610
image: nginx:alpine
711
ports: [80]
812
depends_on:
913
- a
14+
healthcheck:
15+
test: wget --spider -S -T1 http://localhost:80
16+
interval: 1s
17+
timeout: 1s

pkg/e2e/framework.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func NewCLI(t testing.TB, opts ...CLIOption) *CLI {
103103
for _, opt := range opts {
104104
opt(c)
105105
}
106-
t.Log(c.RunDockerComposeCmdNoCheck(t, "version").Combined())
106+
c.RunDockerComposeCmdNoCheck(t, "version")
107107
return c
108108
}
109109

@@ -305,7 +305,10 @@ func (c *CLI) RunDockerComposeCmd(t testing.TB, args ...string) *icmd.Result {
305305
// RunDockerComposeCmdNoCheck runs a docker compose command, don't presume of any expectation and returns a result
306306
func (c *CLI) RunDockerComposeCmdNoCheck(t testing.TB, args ...string) *icmd.Result {
307307
t.Helper()
308-
return icmd.RunCmd(c.NewDockerComposeCmd(t, args...))
308+
cmd := c.NewDockerComposeCmd(t, args...)
309+
cmd.Stdout = os.Stdout
310+
t.Logf("Running command: %s", strings.Join(cmd.Command, " "))
311+
return icmd.RunCmd(cmd)
309312
}
310313

311314
// NewDockerComposeCmd creates a command object for Compose, either in plugin

pkg/e2e/pause_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func TestPauseServiceAlreadyPaused(t *testing.T) {
101101
t.Cleanup(cleanup)
102102

103103
// launch a and wait for it to come up
104-
cli.RunDockerComposeCmd(t, "up", "-d", "a")
104+
cli.RunDockerComposeCmd(t, "up", "--wait", "a")
105105
HTTPGetWithRetry(t, urlForService(t, cli, "a", 80), http.StatusOK, 50*time.Millisecond, 10*time.Second)
106106

107107
// pause a twice - first time should pass, second time fail

0 commit comments

Comments
 (0)