• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

source-academy / py-slang / 30162144554 / 1
86%
main: 86%

Build:
DEFAULT BRANCH: main
Ran 25 Jul 2026 02:59PM UTC
Files 116
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Jul 2026 02:41PM UTC coverage: 86.125%. Remained the same
30162144554.1

push

github

web-flow
Add a self-rescheduling set_timeout chain test (#354)

* py2js: report set_timeout/clear_all_timeout as pending work to the conductor

Fixes source-academy/py-slang#329: set_timeout(f, x) fired reliably
under ~46ms, was unreliable right at that boundary, and silently never
fired at 50ms+. Root cause traced to the host (Source Academy's
frontend): BasicEvaluator.startEvaluator reports RunnerStatus.STOPPED
the instant evaluateChunk()'s promise resolves, with no way to know a
real setTimeout is still scheduled inside the runtime -- the frontend
treats STOPPED as "safe to tear down", killing the Worker (and any
pending timer in it) ~50ms later regardless.

Wires Py2JsRuntime's set_timeout/clear_all_timeout to a new
onPendingWorkChange hook (+1 when scheduled, -1 once the callback
settles or is cancelled), threaded through Py2JsSession and
Py2JsEvaluator.ts into BasicEvaluator's own beginPendingWork()/
endPendingWork() -- see source-academy/conductor#52, which makes
startEvaluator withhold STOPPED until pending work reaches zero.

Depends on source-academy/conductor#52 landing and publishing before
this compiles: Py2JsEvaluatorBase.beginPendingWork/endPendingWork don't
exist on the currently-published @sourceacademy/conductor, so tsc and
CI are expected to fail until that PR merges and this branch's
@sourceacademy/conductor dependency is bumped to the new version.
Opening now as a draft, to keep the two PRs linked and the work
visible while conductor's review is in progress -- not yet mergeable.

Verified against a local build of conductor's fix (temporary portal:
dependency, reverted before this commit -- not part of the diff): 3
Jest tests exercising schedule/fire, clear_all_timeout cancellation,
and a self-rescheduling chain all passed against the real
Py2JsSession/Py2JsRuntime wiring. Will re-verify for real, end-to-end,
once conductor publishes and the dependency bump lands here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session:... (continued)

4405 of 5506 branches covered (80.0%)

Branch coverage included in aggregate %.

9549 of 10696 relevant lines covered (89.28%)

178277.68 hits per line

Source Files on job 30162144554.1
  • Tree
  • List 116
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 30162144554
  • 55ccdfee on github
  • Prev Job for on main (#30148900505.1)
  • Next Job for on main (#30200213350.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc