MCPcopy Index your code
hub / github.com/coder/envbox / WaitForCVMDocker

Function WaitForCVMDocker

integration/integrationtest/docker.go:195–210  ·  view source on GitHub ↗

WaitForCVMDocker waits for the inner container docker daemon to spin up.

(t *testing.T, pool *dockertest.Pool, resource *dockertest.Resource, timeout time.Duration)

Source from the content-addressed store, hash-verified

193
194// WaitForCVMDocker waits for the inner container docker daemon to spin up.
195func WaitForCVMDocker(t *testing.T, pool *dockertest.Pool, resource *dockertest.Resource, timeout time.Duration) {
196 t.Helper()
197
198 ctx, cancel := context.WithTimeout(context.Background(), timeout)
199 defer cancel()
200
201 for r := retry.New(time.Second, time.Second); r.Wait(ctx); {
202 _, err := ExecInnerContainer(t, pool, ExecConfig{
203 ContainerID: resource.Container.ID,
204 Cmd: []string{"docker", "info"},
205 })
206 if err == nil {
207 break
208 }
209 }
210}
211
212// waitForCVM waits for the inner container to spin up.
213func waitForCVM(t *testing.T, pool *dockertest.Pool, resource *dockertest.Resource) bool {

Callers 1

TestDockerFunction · 0.92

Calls 2

ExecInnerContainerFunction · 0.85
WaitMethod · 0.45

Tested by 1

TestDockerFunction · 0.74