Repository navigation
Conversation
…block fetch awaitBlockDone builds one AbortSignal.timeout outside the loop, so its argument is the budget for the whole wait, not for a single change notification. The default was 2000ms, and the only live caller waits on a block that is first downloaded from the remote registry and then run. Two seconds is a race against the network, so 'test JS render enter numbers' failed intermittently in CI with a bare 'Aborted.' Raise the default to 30000ms. Every other caller of this helper in the repo already passes 15-50s for the same reason; 2000 was the outlier, and the file's test timeout is 80s, so the wait still fails well inside it. The abort message now names the block, its last status and the budget, and dumps the overview next to the state, so the next timeout says what was still pending instead of 'Aborted.'
🦋 Changeset detectedLatest commit: 6060a2c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Comment on lines
+40
to
+41
| * download on a CI runner. Other callers of this helper across the repo pass | ||
| * 15-50s for the same reason. |
Contributor
There was a problem hiding this comment.
The comment says other callers of “this helper” pass 15–50-second timeouts, but this helper’s only active caller uses the default. The similarly named helpers elsewhere are separate implementations. Describing them as analogous helpers would make the timeout rationale accurate and easier to verify.
Suggested change
| * download on a CI runner. Other callers of this helper across the repo pass | |
| * 15-50s for the same reason. | |
| * download on a CI runner. Analogous helpers elsewhere in the repo use | |
| * 15-50s for the same reason. |
Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/node/pl-middle-layer/src/middle_layer/render.test.ts
Line: 40-41
Comment:
**Misleading caller description**
The comment says other callers of “this helper” pass 15–50-second timeouts, but this helper’s only active caller uses the default. The similarly named helpers elsewhere are separate implementations. Describing them as analogous helpers would make the timeout rationale accurate and easier to verify.
```suggestion
* download on a CI runner. Analogous helpers elsewhere in the repo use
* 15-50s for the same reason.
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Both copies of the helper build one AbortSignal.timeout outside the wait loop, so the value is the budget for the whole wait rather than for a single change notification, and it has to fit a block that is fetched before it runs. render.test.ts was at 2000ms and sdk/test at 5000ms; both are a race on a cold runner for a caller that passes no timeout of its own. Set both to 10s.
vgpopov
approved these changes
Sep 24, 2026
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.
Stacked on #1836 (
chore/build-on-windows) — review that one first; this branchonly adds the commits on top. Base retargets to
mainonce #1836 merges.Fixes the intermittent
test JS render enter numbersfailure seen on #1836,which is a pre-existing flake on
main, not something that branch introduced.Decisions
The bug is the scope of the abort signal, not its value.
awaitBlockDonebuilds one
AbortSignal.timeout(timeout)outside thewhileloop and reusesit for every
overview.awaitChange(...). So the value is the budget for theentire wait, not for one change notification — a name that reads like a per-wait
timeout but behaves like a deadline. Both copies of the helper have this shape.
The old budgets could not cover the work they were waiting on. The live
caller in
render.test.tsadds a block byfrom-registry-v1fromhttps://block.registry.platforma.bio/releasesand then runs it, so its 2000mshad to cover a cold remote fetch plus execution on a CI runner. That is a race
against the network, which is why it failed intermittently and why the failure
looked like nothing in particular.
Both defaults are now 10s.
render.test.tswas 2000ms andDEFAULT_AWAIT_BLOCK_DONE_TIMEOUTinsdk/testwas 5000ms. 10s sits wellinside the 80s
testTimeoutof the middle-layer suite, so a genuinely stuckblock still fails the test rather than hanging it, and callers that need longer
keep passing their own value (15s–50s across the repo).
Raised the defaults rather than restructuring the helper. A progress
watchdog — reset the deadline on each observed change, with an overall cap —
buys nothing here: during the fetch there is no overview change to reset on,
which is exactly the interval that has to be tolerated, so the idle bound would
have to be just as generous as the total. It would also be a new pattern in a
repo that consistently uses a single overall budget.
The abort message now says what was pending. It was a bare
"Aborted.",which is what made the CI failure take a log dig to identify. It now names the
block, its last
calculationStatusand the budget, and dumpsblockOverviewbeside the block state — matching what the
sdk/testcopy already prints.Key files to review
lib/node/pl-middle-layer/src/middle_layer/render.test.ts— the signal'sscope is the whole point, so read the comment against the loop below it.
sdk/test/src/test-block.ts— same shape, published package; the defaulthere is exposed to every block test that does not pass its own timeout.
.changeset/await-block-done-default-timeout.md— patch bump for@platforma-sdk/test.Verification
types:check,formatter:checkandlinter:checkpass on both packages. Ihave not reproduced the flake locally — it needs a live backend and a cold
registry fetch, and a green local run would not be evidence either way for a
timing race. The claim rests on the read of the code: a 2s deadline spanning a
network download, with every sibling caller at 15s or more.