Repository navigation
Increase timeout for waiting for host port bindings to 30 seconds - #1494
Conversation
Port binding can take longer than 10 seconds on CPU-constrained hosts (16.7 seconds measured in #1446).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to When a host port does not bind, startup-related operations may wait up to 30 seconds rather than 10. This is the stated behavior, and no actionable merge risk remains. Pre-merge checks |
|
Summary
GenericContainerwaits for the host port bindings to appear in the inspect result before the wait strategy runs. That wait had a fixed 10 second limit, which is not enough on CPU-constrained hosts: #1446 measured port binding taking up to 16.7 seconds with six containers starting concurrently on a 2-vCPU runner.This raises the fixed limit to 30 seconds. It applies to
start(), starting a stopped reused container, andrestart(), which all share the same default.The limit stays independent of
withStartupTimeout(). Tying the two together (the approach in #1447) lets each phase consume the full startup timeout, so a 10 minute timeout could wait close to 20 minutes.Verification
npm run formatnpm run lintnpm run check-compilesnpx vitest runoninspect-container-util-ports-exposed.test.ts,generic-container-auto-cleanup.test.ts,generic-container-restart.test.tsandgeneric-container-reuse.test.tsTest results
check-compilesare clean.client.container.inspectto report ports as unbound for 15 seconds after the container starts.mainit fails withTimed out after 10000ms while waiting for container ports to be bound to the host.start()andrestart().No test is added for the new value: asserting it needs either a 30 second real wait or a check of the constant itself.
Not breaking
There is no API change. The only behaviour change is that a container whose ports never bind now fails after 30 seconds instead of 10.
Closes #1446