Skip to content

fix(tests): supply AbortController in test_viewer_streaming camera modifier context - #8943

Open
Cryptoteep wants to merge 1 commit into
ItsNotRexed:mainfrom
Cryptoteep:fix/test-viewer-streaming-abortcontroller
Open

Cryptoteep wants to merge 1 commit into
ItsNotRexed:mainfrom
Cryptoteep:fix/test-viewer-streaming-abortcontroller

Conversation

@Cryptoteep

Copy link
Copy Markdown

When running node --test tests/test_viewer_streaming.cjs, the test Shift speeds the camera up and Ctrl slows it down, on either side of the keyboard failed with:

ReferenceError: AbortController is not defined
    at loadWorld (evalmachine.<anonymous>:55:22)
    at evalmachine.<anonymous>:423:5

The camera modifier test constructs a dedicated vm.runInNewContext sandbox with mocked DOM and Three.js objects. When loadWorld() executes, it instantiates new AbortController().

Supplying AbortController, setTimeout, and clearTimeout from globalThis in the mock context resolves the missing runtime globals.

Verification

  • node --test tests/test_viewer_streaming.cjs: 57 passed, 0 failed.
  • python -I scripts/check_no_game_data.py tests/test_viewer_streaming.cjs: clean.

@KotikVanil

Copy link
Copy Markdown

This is the same TEST-1354 camera fixture fix as #5692, whose original claim is here. This diff has the same git patch-id --stable as #7063, which its author already closed in favor of #5692. #5692 is still open and mergeable. Flagging the overlap so review can land in one place. AI-assisted (Codex).

@jamesn-xt

Copy link
Copy Markdown

Independent reproduction on main 867d922f09b86583859796a174df89555fb32da8, Windows 11 x64, Node.js 24.18.0.

node --test tests/test_viewer_streaming.cjs produced 56 passes and 1 failure. A focused rerun with node --test --test-name-pattern='Shift speeds' tests/test_viewer_streaming.cjs reproduces the same failure: ReferenceError: AbortController is not defined in loadWorld, reached by the camera-speed test's VM context at tests/test_viewer_streaming.cjs:391.

The test fails during viewer startup before it reaches the movement assertions. This independently confirms the missing VM global addressed here.

These results are against the stated main commit. I have not tested this PR's head. Synthetic loader/clock only, no browser or game files. AI-assisted reproduction and report.

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.

3 participants