tests: give the camera vm context the globals the viewer uses at load #13

Merged
wavehs merged 1 commit from upstream-pr/13 into main 2026-11-24 02:26:08 +00:00
wavehs commented 2026-11-24 01:39:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T01:39:29Z.


Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches tests/test_viewer_streaming.cjs.

Depends on: none.

What and why

viewer/index.html calls loadWorld() at module scope; it creates an AbortController and arms a setTimeout. The Shift/Ctrl camera test runs the viewer in a vm context whose sandbox does not provide either, so the context throws before the camera is returned:

not ok 16 - Shift speeds the camera up and Ctrl slows it down, on either side of the keyboard
  error: 'AbortController is not defined'

On Node 20 it then fails on setTimeout once AbortController is added. This is why the viewer-tests job fails on every pull request, including #5-#11, whose diffs do not touch the viewer:

2026-11-24T01:28:53.3954203Z   ReferenceError [Error]: AbortController is not defined

A vm context has only what the sandbox gives it, on Node 24 as on Node 20, so the test now provides the two globals. The timers never fire: the manifest this context gets has no chunks to stream, and the test only steps one frame explicitly.

Tested

macOS 15 arm64 (Apple M3 Pro), Node 20.20.2, no browser and no game data:

tree node --test tests/test_*.cjs
main@30daa6958 67 pass, 1 fail (the test above)
this commit 68 pass, 0 fail

Node 24 is what CI runs; the missing globals are the same there (the CI log above is Node 24). Not run: a browser, any GPU or game data.

AI-assisted: yes.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: test-only.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464438290 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/13). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T01:39:29Z. --- Claimed in the coordination issue as: none — the original project's coordination issue was lost with its repository, and this repository has no such issue yet. No open pull request touches `tests/test_viewer_streaming.cjs`. Depends on: none. ### What and why `viewer/index.html` calls `loadWorld()` at module scope; it creates an `AbortController` and arms a `setTimeout`. The Shift/Ctrl camera test runs the viewer in a `vm` context whose sandbox does not provide either, so the context throws before the camera is returned: ``` not ok 16 - Shift speeds the camera up and Ctrl slows it down, on either side of the keyboard error: 'AbortController is not defined' ``` On Node 20 it then fails on `setTimeout` once `AbortController` is added. This is why the `viewer-tests` job fails on every pull request, including #5-#11, whose diffs do not touch the viewer: ``` 2026-11-24T01:28:53.3954203Z ReferenceError [Error]: AbortController is not defined ``` A `vm` context has only what the sandbox gives it, on Node 24 as on Node 20, so the test now provides the two globals. The timers never fire: the manifest this context gets has no chunks to stream, and the test only steps one frame explicitly. ### Tested macOS 15 arm64 (Apple M3 Pro), Node 20.20.2, no browser and no game data: | tree | `node --test tests/test_*.cjs` | |---|---| | `main@30daa6958` | 67 pass, 1 fail (the test above) | | this commit | 68 pass, 0 fail | Node 24 is what CI runs; the missing globals are the same there (the CI log above is Node 24). Not run: a browser, any GPU or game data. AI-assisted: yes. ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (Not applicable: test-only.)
wavehs commented 2026-11-24 02:18:20 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-24T02:18:20Z.


Batch note for my six open fix pull requests (#13, #20, #21, #22, #23, #26): stacked on main@9ec34cdff they make the whole local run green, so they can be merged in any order without waiting for each other's CI to go green first — each one alone leaves the other red files in place, and the Linux/macOS loops stop at the first failure (python -I "$t" || exit 1).

Stacked tree, macOS 15 arm64 / CPython 3.15.2, CPU only, no game files:

node --test tests/test_*.cjs                  # pass 68, fail 0
python -I scripts/run_semantic_tests.py tests/semantic
                                              463 files, 6075 tests, 1 file failed: test_exec_computed
python -I <every stdlib tests/test_*.py>      463 files, 0 failed

The one remaining translator file, test_exec_computed, is SHADER-1264 and is fixed by #24 (ddddddddwp), not by any of mine; I verified their branch separately (that file passes, the suite is then down to test_image_atomics_guard, which #20 fixes).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7119994591 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/13#issuecomment-7119994591). Originally posted by [wavehs](https://github.com/wavehs) on 2026-11-24T02:18:20Z. --- Batch note for my six open fix pull requests (#13, #20, #21, #22, #23, #26): stacked on `main@9ec34cdff` they make the whole local run green, so they can be merged in any order without waiting for each other's CI to go green first — each one alone leaves the other red files in place, and the Linux/macOS loops stop at the first failure (`python -I "$t" || exit 1`). Stacked tree, macOS 15 arm64 / CPython 3.15.2, CPU only, no game files: ``` node --test tests/test_*.cjs # pass 68, fail 0 python -I scripts/run_semantic_tests.py tests/semantic 463 files, 6075 tests, 1 file failed: test_exec_computed python -I <every stdlib tests/test_*.py> 463 files, 0 failed ``` The one remaining translator file, `test_exec_computed`, is SHADER-1264 and is fixed by #24 (`ddddddddwp`), not by any of mine; I verified their branch separately (that file passes, the suite is then down to `test_image_atomics_guard`, which #20 fixes).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!13
No description provided.