Skip to content

Conversation

@nickmarden
Copy link
Contributor

Replace time.Sleep with channel-based synchronization in server shutdown tests to ensure deterministic execution:

  • TestServer_Shutdown_WithRunningServers: Add httpReady/httpsReady channels to wait for Serve goroutines to start before shutdown
  • TestServer_Shutdown_ErrorPaths: Same synchronization plus WaitGroup to ensure HTTP request goroutines complete before test ends

This fixes an intermittent CI failure where line 123 of server.go (httpServer.Shutdown) was reported as uncovered due to race conditions in coverage tracking.

Replace time.Sleep with channel-based synchronization in server
shutdown tests to ensure deterministic execution:

- TestServer_Shutdown_WithRunningServers: Add httpReady/httpsReady
  channels to wait for Serve goroutines to start before shutdown
- TestServer_Shutdown_ErrorPaths: Same synchronization plus WaitGroup
  to ensure HTTP request goroutines complete before test ends

This fixes an intermittent CI failure where line 123 of server.go
(httpServer.Shutdown) was reported as uncovered due to race conditions
in coverage tracking.
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud
Copy link

@nickmarden nickmarden merged commit 2e6cabd into main Jan 23, 2026
9 checks passed
@nickmarden nickmarden deleted the fix-server-test-flakiness branch January 23, 2026 09:23
@github-actions
Copy link

Docker Images Built

Images are available for testing:

# gatekeeperd
docker pull ghcr.io/tight-line/gatekeeperd:pr-13-4960335

# gatekeeper-relay
docker pull ghcr.io/tight-line/gatekeeper-relay:pr-13-4960335

docker-compose.yml

GATEKEEPERD_IMAGE=ghcr.io/tight-line/gatekeeperd:pr-13-4960335 \
RELAY_IMAGE=ghcr.io/tight-line/gatekeeper-relay:pr-13-4960335 \
docker-compose --profile relay up

Helm (values override)

image:
  repository: ghcr.io/tight-line/gatekeeperd  # or gatekeeper-relay
  tag: "pr-13-4960335"

Images expire ~15 days after PR closes.

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