Skip to content

test_viewer_streaming: fix the false failure in the Shift-camera sandbox (missing AbortController) - #7063

Closed
antoinecaputo wants to merge 1 commit into
ItsNotRexed:mainfrom
antoinecaputo:viewer-streaming-abortcontroller
Closed

antoinecaputo wants to merge 1 commit into
ItsNotRexed:mainfrom
antoinecaputo:viewer-streaming-abortcontroller

Conversation

@antoinecaputo

Copy link
Copy Markdown

node --test tests/test_viewer_streaming.cjs failed 1 of 57 on main on Node v24.21.0 (the major CI tests): the Shift speeds the camera up and Ctrl slows it down case died with ReferenceError: AbortController is not defined. The vm sandbox built for that one case (tests/test_viewer_streaming.cjs:391-416) injects neither AbortController nor setTimeout/clearTimeout, while every sibling sandbox in the same file (lines 17, 356, 453) does; the code under test calls new AbortController() (viewer/index.html, loadWorld).

The fix adds the three globals, copied verbatim from the sibling sandbox at line 356. No expectation or production change.

Tested: node --test tests/test_viewer_streaming.cjs — 57/57 pass, twice, Node v24.21.0 on macOS; 56/57 before the change. CPU only; no browser, no network, no game data.

Claim: #6910 (comment)
AI-assisted.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

No open issues 🎉

What changed in this PR

Fixes a Node v24 VM-sandbox test failure in test_viewer_streaming by aligning the Shift/Ctrl camera-speed sandbox globals with other sandboxes in the same file.

Changes:

  • Inject AbortController, setTimeout, and clearTimeout into the VM sandbox used by the “Shift speeds the camera up…” test case.
File Description
tests/​test_viewer_streaming.cjs Adds missing timer and abort globals to the one sandbox that lacked them, preventing AbortController is not defined in Node v24 tests.

Review effort: Lite

@kapitche

Copy link
Copy Markdown
Contributor

Tested 4773b72 merged with main 8575d36 on Linux/Node v22.23.5 (no Python involved; tests/test_viewer_streaming.cjs only): pass

  • node --test tests/test_viewer_streaming.cjs: 57 pass, 0 fail
  • Negative control: the PR adds one line to the test's synthetic window (AbortController, setTimeout, clearTimeout). With the file restored from upstream/main (git checkout upstream/main -- tests/test_viewer_streaming.cjs) the same command gives 56 pass, 1 fail, so the line is what makes the 'Shift speeds the camera up and Ctrl slows it down' test pass against current viewer code. Restored with git checkout HEAD --.

No viewer source changes in the PR.

@ciagnij

ciagnij commented Nov 23, 2026

Copy link
Copy Markdown

Independent Windows check with Node 24.22.3, the Node major used in CI. On main 26fdf41, the full viewer check (node --test tests/test_*.cjs) gave 65 passes and one failure. The Shift/Ctrl camera test raised ReferenceError: AbortController is not defined. Cherry-picking 4773b72 onto the same snapshot gave 66 passes and zero failures. Synthetic fixtures only. AI-assisted (Codex).

@illusionart453-max

Copy link
Copy Markdown

Independent native Windows/Node 24.22.3 at 4773b72: node --test tests/test_viewer_streaming.cjs passes 57/57, no skips. Main 8575d36 baseline is 56 pass/1 fail with AbortController undefined in the Shift-camera VM. Overlap with #5692/#7085/#7409 should be resolved at merge time. Synthetic VM only, no browser/game files. AI-assisted (Codex).

@itzJaack

Copy link
Copy Markdown

Independent check on Windows 11 with Node v26.13.0. On a fresh main snapshot, node --test tests/test_viewer_streaming.cjs failed in the Shift/Ctrl camera-speed case with ReferenceError: AbortController is not defined. After applying the one-line diff from this PR, the same command reported 57 passed, 0 failed, 0 skipped. Node VM tests only, no GPU or game files involved. AI-assisted verification.

@Daazd

Daazd commented Nov 23, 2026

Copy link
Copy Markdown

Independent check (Linux, Python 3.12.3, Node 24.13, CPU only, no game files): head 4773b7275 merged onto main 6a4299563: merges clean.

  • node --test tests/test_viewer_streaming.cjs: ℹ pass 57 ℹ fail 0 (exit 0)

Fixes the red viewer test on main (Shift speeds the camera up...: AbortController is not defined). Same fix as #5692 and #7085; all three pass.

AI-assisted (Claude Code).

@naxhh

naxhh commented Nov 23, 2026

Copy link
Copy Markdown

Duplicate of #5692, which claimed this first as TEST-1354 (claim). It passes 57/57 here too (Windows 11, Node 26.13.1), so one of the two can be closed.

@antoinecaputo

Copy link
Copy Markdown
Author

Closing in favor of #5692 — it claimed this item first as TEST-1354 (issues/5581#issuecomment-7100079959), before my claim (issues/6910#issuecomment-7106040584). The bug and fix are the same (AbortController missing from the camera-speed vm context in tests/test_viewer_streaming.cjs); the five independent checks on my head (Windows ×3 on Node 22/24/26, Linux ×2, all 57/57 with main failing on AbortController is not defined) equally describe the fixed behavior, so #5692's one-liner should merge cleanly with that confidence. AI-assisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants