Skip to content

fix(cli): clamp setTimeout to 1ms#5309

Merged
jedel1043 merged 1 commit intoboa-dev:mainfrom
ivankra:setTimeout
Apr 9, 2026
Merged

fix(cli): clamp setTimeout to 1ms#5309
jedel1043 merged 1 commit intoboa-dev:mainfrom
ivankra:setTimeout

Conversation

@ivankra
Copy link
Copy Markdown
Contributor

@ivankra ivankra commented Apr 9, 2026

CLI's custom executor can starve the event loop when doing a setTimeout(fn, 0) loop. This happens during tests like test/built-ins/Atomics/waitAsync/bigint/true-for-timeout.js

Solution: clamp the delay to 1ms minimum (same as Node.js).

Fixes #5308

CLI's custom executor can starve the event loop when doing
a setTimeout(fn, 0) loop.  This happens during tests like
test/built-ins/Atomics/waitAsync/bigint/true-for-timeout.js

Solution: clamp the delay to 1ms minimum (same as Node.js).

Fixes boa-dev#5308
@ivankra ivankra requested a review from a team as a code owner April 9, 2026 12:38
@github-actions github-actions bot added Waiting On Review Waiting on reviews from the maintainers C-CLI Issues and PRs related to the Boa command line interface. and removed Waiting On Review Waiting on reviews from the maintainers labels Apr 9, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Test262 conformance changes

Test result main count PR count difference
Total 53,125 53,125 0
Passed 51,049 51,049 0
Ignored 1,482 1,482 0
Failed 594 594 0
Panics 0 0 0
Conformance 96.09% 96.09% 0.00%

Tested main commit: 352ec3dd2e814e9b2b5ee322c684605533b96344
Tested PR commit: 53c1e85f4826f7b5ab60435deb3a869bdc122a03
Compare commits: 352ec3d...53c1e85

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.69%. Comparing base (6ddc2b4) to head (53c1e85).
⚠️ Report is 947 commits behind head on main.

Files with missing lines Patch % Lines
cli/src/executor.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5309       +/-   ##
===========================================
+ Coverage   47.24%   59.69%   +12.45%     
===========================================
  Files         476      589      +113     
  Lines       46892    63665    +16773     
===========================================
+ Hits        22154    38006    +15852     
- Misses      24738    25659      +921     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jedel1043 jedel1043 added this pull request to the merge queue Apr 9, 2026
@jedel1043 jedel1043 added the A-Bug Something isn't working label Apr 9, 2026
Merged via the queue into boa-dev:main with commit d6d76d8 Apr 9, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Bug Something isn't working C-CLI Issues and PRs related to the Boa command line interface.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli/src/executor.rs starvation bug with setTimeout(..., 0)

2 participants