MCPcopy
hub / github.com/moby/moby / assertContainerExitCode

Function assertContainerExitCode

integration/container/restart_test.go:299–310  ·  view source on GitHub ↗
(t *testing.T, wait client.ContainerWaitResult, expected int64, timeout time.Duration)

Source from the content-addressed store, hash-verified

297}
298
299func assertContainerExitCode(t *testing.T, wait client.ContainerWaitResult, expected int64, timeout time.Duration) {
300 t.Helper()
301
302 select {
303 case err := <-wait.Error:
304 assert.NilError(t, err)
305 case res := <-wait.Result:
306 assert.Check(t, is.Equal(res.StatusCode, expected))
307 case <-time.After(timeout):
308 t.Fatal("timeout waiting for container exit")
309 }
310}
311
312func TestContainerRestartPolicyOnFailure(t *testing.T) {
313 ctx := setupTest(t)

Callers 1

Calls 3

CheckMethod · 0.80
EqualMethod · 0.80
HelperMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…