diff --git a/web/backend/api/gateway_test.go b/web/backend/api/gateway_test.go index 5c94f0b89..504d091af 100644 --- a/web/backend/api/gateway_test.go +++ b/web/backend/api/gateway_test.go @@ -596,6 +596,11 @@ func TestGatewayStatusReturnsErrorAfterStartupWindowExpires(t *testing.T) { func TestGatewayStatusReturnsRestartingDuringRestartGap(t *testing.T) { resetGatewayTestState(t) + // Mock health check to return error, so it won't override our "restarting" status + gatewayHealthGet = func(url string, timeout time.Duration) (*http.Response, error) { + return nil, errors.New("mock health check error") + } + configPath := filepath.Join(t.TempDir(), "config.json") h := NewHandler(configPath) mux := http.NewServeMux() @@ -738,6 +743,11 @@ func TestGatewayRestartKeepsOldProcessWhenItDoesNotExitInTime(t *testing.T) { func TestGatewayRestartReturnsErrorStatusWhenReplacementFailsToStart(t *testing.T) { resetGatewayTestState(t) + // Mock health check to return error, so it won't override our "error" status + gatewayHealthGet = func(url string, timeout time.Duration) (*http.Response, error) { + return nil, errors.New("mock health check error") + } + configPath := filepath.Join(t.TempDir(), "config.json") cfg := config.DefaultConfig() cfg.Agents.Defaults.ModelName = cfg.ModelList[0].ModelName