From a92c61cb5a0b48ee4fc641b531c97cecea6901cc Mon Sep 17 00:00:00 2001 From: Landon Cox Date: Mon, 4 May 2026 11:05:51 -0700 Subject: [PATCH] fix: increase integration test timeouts for Docker image pulls in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TestBinaryInvocation_LogFileCreation and TestDIFCConfigWithGuards fail in CI because Docker images (alpine:latest, mcp/playwright:latest) are not pre-pulled and the pull time exceeds the short test timeouts (5s and 15s respectively). Increase timeouts to accommodate Docker pulls: - TestBinaryInvocation_LogFileCreation: 5s → 40s (context 10s → 45s) - TestBinaryInvocation_LogDirEnvironmentVariable: 5s → 40s (context 10s → 45s) - TestDIFCConfigWithGuards: 15s → 50s (context 30s → 60s) Fixes: https://github.com/github/gh-aw-mcpg/actions/runs/25325915594 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- test/integration/binary_test.go | 12 ++++++------ test/integration/difc_config_test.go | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/integration/binary_test.go b/test/integration/binary_test.go index 72b8e2b5..2a61c010 100644 --- a/test/integration/binary_test.go +++ b/test/integration/binary_test.go @@ -848,7 +848,7 @@ func TestBinaryInvocation_LogFileCreation(t *testing.T) { defer os.Remove(configFile) // Start the server process with custom log directory - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 45*time.Second) defer cancel() port := "13006" @@ -873,9 +873,9 @@ func TestBinaryInvocation_LogFileCreation(t *testing.T) { } }() - // Wait for server to start + // Wait for server to start — allow time for Docker image pulls in CI serverURL := "http://127.0.0.1:" + port - if !waitForServer(t, serverURL+"/health", 5*time.Second) { + if !waitForServer(t, serverURL+"/health", 40*time.Second) { t.Logf("STDOUT: %s", stdout.String()) t.Logf("STDERR: %s", stderr.String()) t.Fatal("Server did not start in time") @@ -996,7 +996,7 @@ func TestBinaryInvocation_LogDirEnvironmentVariable(t *testing.T) { defer os.Remove(configFile) // Start the server process with MCP_GATEWAY_LOG_DIR environment variable (no --log-dir flag) - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 45*time.Second) defer cancel() port := "13007" @@ -1023,9 +1023,9 @@ func TestBinaryInvocation_LogDirEnvironmentVariable(t *testing.T) { } }() - // Wait for server to start + // Wait for server to start — allow time for Docker image pulls in CI serverURL := "http://127.0.0.1:" + port - if !waitForServer(t, serverURL+"/health", 5*time.Second) { + if !waitForServer(t, serverURL+"/health", 40*time.Second) { t.Logf("STDOUT: %s", stdout.String()) t.Logf("STDERR: %s", stderr.String()) t.Fatal("Server did not start in time") diff --git a/test/integration/difc_config_test.go b/test/integration/difc_config_test.go index 0d3e6d8c..17aa9b78 100644 --- a/test/integration/difc_config_test.go +++ b/test/integration/difc_config_test.go @@ -228,7 +228,7 @@ func TestDIFCConfigWithGuards(t *testing.T) { } }`, port) - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) defer cancel() cmd := exec.CommandContext(ctx, binary, "--config-stdin", "--log-dir", logDir) @@ -242,9 +242,9 @@ func TestDIFCConfigWithGuards(t *testing.T) { err := cmd.Start() require.NoError(t, err, "Failed to start gateway") - // Wait for full startup — ensures all servers are processed and log files flushed - ok := waitForStderr(&stderr, "Starting MCPG", 15*time.Second) - require.Truef(t, ok, "timeout waiting for gateway startup within %s; stderr:\n%s", 15*time.Second, stderr.String()) + // Wait for full startup — allows time for Docker image pulls in CI + ok := waitForStderr(&stderr, "Starting MCPG", 50*time.Second) + require.Truef(t, ok, "timeout waiting for gateway startup within %s; stderr:\n%s", 50*time.Second, stderr.String()) // Try health check resp, err := http.Get(fmt.Sprintf("http://127.0.0.1:%d/health", port))