From da78da533c523740c52c008cf2d4f1f67ef4fa3c Mon Sep 17 00:00:00 2001 From: Steven Hartland Date: Tue, 30 Jul 2024 11:10:10 +0100 Subject: [PATCH] fix: container timeout test Reduce the timeout for TestContainerCreationTimesOutWithHttp to reduce the likely hood of failure. --- docker_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docker_test.go b/docker_test.go index fdc3196dae..b0a78b346d 100644 --- a/docker_test.go +++ b/docker_test.go @@ -658,14 +658,12 @@ func TestContainerCreationTimesOutWithHttp(t *testing.T) { ExposedPorts: []string{ nginxDefaultPort, }, - WaitingFor: wait.ForHTTP("/").WithStartupTimeout(1 * time.Second), + WaitingFor: wait.ForHTTP("/").WithStartupTimeout(time.Millisecond * 500), }, Started: true, }) CleanupContainer(t, nginxC) - if err == nil { - t.Error("Expected timeout") - } + require.Error(t, err, "expected timeout") } func TestContainerCreationWaitsForLogContextTimeout(t *testing.T) {