Skip to content

fix(tests): filter telemetry fetch calls in DO/Hetzner mocks#3391

Open
la14-1 wants to merge 1 commit intomainfrom
fix/flaky-test-telemetry-pollution
Open

fix(tests): filter telemetry fetch calls in DO/Hetzner mocks#3391
la14-1 wants to merge 1 commit intomainfrom
fix/flaky-test-telemetry-pollution

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented May 5, 2026

Summary

  • Fixes 2 consistently flaky tests that failed in the full parallel suite but passed in isolation
  • Root cause: PostHog telemetry fetch() calls fired during async test execution, polluting callCount in mocks that captured all globalThis.fetch traffic
  • Fix: URL-filter mocks to only count calls to the relevant API domain (digitalocean/hetzner)

Tests fixed

  • doApi 401 OAuth recovery > attempts OAuth recovery on 401 before throwing
  • hetzner/createServer > cleans up orphaned primary IPs on resource_limit_exceeded and retries

Test plan

  • Full test suite passes: 2177 pass, 0 fail (verified 3 consecutive runs)
  • Lint passes

-- refactor/test-engineer

PostHog telemetry fires fetch calls during parallel test execution,
polluting callCount in tests that mock globalThis.fetch. Filter by URL
to only count calls to the relevant API domain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants