Repository navigation
Conversation
responsiveTimeout skipped every tick that arrived more than twice its delay late, so a host that was slow on every tick never expired the budget. On a loaded CI runner the 30 ms test budget never ran out and the v5.16.0 quality gate failed; in production a child that never appears was never declared stuck under sustained slowness. A late tick now spends at most two ticks of budget. A stall that exhausts the budget still grants the child's events one more tick before expiry. The clock and scheduler are injectable, and two new tests drive a slow host by hand with no wall-clock threshold.
Contributor
|
@jorgepb96, the following checks have failed:
Please resolve the reported failures so that all required checks pass. A maintainer with repository write access can comment Latest revision: |
This branch has not been deployed
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
responsiveTimeout(added in #1314) skipped every timer tick that arrived more than2 × delaylate, charging none of its elapsed time to the budget. On a host that is late on every tick, the budget never ran out:Fix
min(elapsed, 2 × delay)instead of nothing, so sustained lateness still uses up the budget, at worst at half the wall-clock rate.performance.nowand the real timers). The only production caller,backgroundProcess.ts, is unchanged.Tests
Two new deterministic tests in
scripts/test-document-work.mjsdrive a slow host by hand, with no wall-clock threshold:Both fail on the old rule (checked by restoring it temporarily) and pass with the fix.
node --test scripts/test-document-work.mjson Node 22: 6/6 passing, three runs in a row.tsc -p electron/tsconfig.jsonand eslint on the touched files are clean.