MCPcopy
hub / github.com/docker/compose / TestAttachRestart

Function TestAttachRestart

pkg/e2e/compose_test.go:142–159  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

140}
141
142func TestAttachRestart(t *testing.T) {
143 c := NewParallelCLI(t)
144
145 cmd := c.NewDockerComposeCmd(t, "--ansi=never", "--project-directory", "./fixtures/attach-restart", "up")
146 res := icmd.StartCmd(cmd)
147 t.Cleanup(func() {
148 c.RunDockerComposeCmd(t, "-p", "attach-restart", "down")
149 })
150
151 c.WaitForCondition(t, func() (bool, string) {
152 debug := res.Combined()
153 return strings.Count(res.Stdout(),
154 "failing-1 exited with code 1") == 3, fmt.Sprintf("'failing-1 exited with code 1' not found 3 times in : \n%s\n",
155 debug)
156 }, 4*time.Minute, 2*time.Second)
157
158 assert.Equal(t, strings.Count(res.Stdout(), "failing-1 | world"), 3, res.Combined())
159}
160
161func TestInitContainer(t *testing.T) {
162 c := NewParallelCLI(t)

Callers

nothing calls this directly

Calls 4

NewParallelCLIFunction · 0.85
NewDockerComposeCmdMethod · 0.80
RunDockerComposeCmdMethod · 0.80
WaitForConditionMethod · 0.80

Tested by

no test coverage detected