fix(ci): wait for collator RPC before ts client connects#4063
Merged
Conversation
The release ts-test could hang for the full 30-min GH-action timeout at "wait for parachain to produce block #1". Root cause (found via the node logs captured by the previous fix): the polkadot-js client in wait-finalized-block.ts opened ws://127.0.0.1:9944 before the collator's RPC was listening — in the release path, docker image load delays collator startup by ~30s. When the WS opens before the port is up, ApiPromise.create() hangs indefinitely (past the script's own 5-min timeout, since that timer's cleanup path assumes a live api). launch-network.sh now polls the collator's `system_health` RPC until it answers (up to ~3min) before running wait-finalized-block. Verified locally against a stable2512 node: the client now connects and its subscribeFinalizedHeads callback fires (previously it hung in ApiPromise.create()). Test-infra only; no runtime/node change.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Problem
The release
create-release-draftheima ts-test hung for the full 30-min GH-action timeout atwait for parachain to produce block #1— never printing anything afterConnecting to parachain ws://127.0.0.1:9944.Using the node logs captured by #4062, the node was proven healthy (finalized to #252, zero panics, RPC bound on
0.0.0.0:9944). The stall was entirely client-side:ApiPromise.create()inwait-finalized-block.tsnever connected.Root cause
A startup race. In the release path,
build-parachain-clientfinishes and the docker image loads slowly, so the collator's RPC comes up ~30s after the ts client opens the WS:ws://127.0.0.1:9944at 22:33:35When the WS opens before the RPC port is listening,
ApiPromise.create()hangs indefinitely — past the script's own 5-min timeout (that timer's cleanup path assumes a liveapi, so it never actually exits). Confirmed the client itself is fine: polkadot-js16.5.6connects to a live stable2512 node in ~0.2s.Fix
launch-network.shpolls the collator'ssystem_healthRPC until it answers (up to ~3 min) before runningwait-finalized-block. Test-infra only — no runtime/node change.Verification
Local stable2512 node via the edited script:
collator RPC is ready (after ~24s)— poll detects readinesssubscribeFinalizedHeadsfires (Parachain finalized block #0 ...), where before it hung inApiPromise.create()(Local parachain stays at #0 due to an unrelated zombienet core-assignment quirk; the point proven here is that the connect race is gone. In CI the node does finalize, so this unblocks the ts-test.)