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))