Skip to content

fix: mock registry API in tests and add HTTP client timeouts#2025

Merged
jlaneve merged 1 commit intomainfrom
fix/mock-registry-tests
Mar 3, 2026
Merged

fix: mock registry API in tests and add HTTP client timeouts#2025
jlaneve merged 1 commit intomainfrom
fix/mock-registry-tests

Conversation

@jlaneve
Copy link
Contributor

@jlaneve jlaneve commented Mar 3, 2026

Summary

  • Registry tests (cmd/registry) were making real HTTP calls to api.astronomer.io with no timeout on the HTTP client, causing CI to hang for 120+ seconds and fail when the API is slow or unresponsive
  • Replaced real API calls with httptest mock servers so tests are fast, deterministic, and have no external dependency
  • Added a 30-second timeout to HTTP clients in RequestAndGetJSONBody and DownloadResponseToFile to prevent the CLI itself from hanging indefinitely

Test plan

  • go test -count=1 ./cmd/registry/... passes in <1s (was 120s+ timeout)
  • Full go test ./... passes

🤖 Generated with Claude Code

Registry tests were making real HTTP calls to api.astronomer.io with no
timeout, causing CI failures when the API is slow or unresponsive. This
replaces real API calls with httptest mock servers and adds a 30s timeout
to HTTP clients in httputil.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jlaneve jlaneve requested a review from a team as a code owner March 3, 2026 17:11
@jlaneve jlaneve merged commit 63e49e1 into main Mar 3, 2026
6 of 7 checks passed
@jlaneve jlaneve deleted the fix/mock-registry-tests branch March 3, 2026 20:39
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