Repository navigation
fix(test): wait up to 5s for HTTP server startup - #1482
Open
UchihaIthachi wants to merge 1 commit into
Open
UchihaIthachi wants to merge 1 commit into
UchihaIthachi wants to merge 1 commit into
Conversation
Cali0707
reviewed
Oct 8, 2026
| @@ -0,0 +1,37 @@ | |||
| package test | |||
Collaborator
There was a problem hiding this comment.
let's not add a test file to test our internal testing helpers....
Author
There was a problem hiding this comment.
Makes sense, removed it. The existing pkg/http tests already exercise WaitForServer
WaitForServer gave up after 10 x 50ms, which is too short on slow runners such as macos-15-intel. Poll until a 5s deadline instead. httpContext had its own copy of the same loop and continued silently if the server never started; use the shared helper and fail instead. Fixes containers#1445 Signed-off-by: UchihaIthachi <2020thlf@gmail.com>
UchihaIthachi
force-pushed
the
test/http-startup-wait
branch
from
October 8, 2026 13:42
e684541 to
ca77f0f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1445
As noted in the issue, the test HTTP server was sometimes still starting
when tests connected to it.
WaitForServeronly waited ~500ms (10 × 50ms);it now polls until a 5s deadline and returns the last dial error on timeout.
httpContext.beforeEachhad its own copy of the same loop and continuedsilently if the server never started. It now uses the shared helper, dials
127.0.0.1 (which reaches the server for every bind address the tests use),
and fails if the server doesn't come up.
Testing:
make buildgo test -race -count=3 ./internal/test/ ./pkg/http/ ./pkg/kubernetes-mcp-server/cmd/go test -count=20 -run 'TestWellknown|TestBindAddress' ./pkg/http/Developed with AI assistance; I reviewed and tested all changes.