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

Manually merged
github merged 1 commit from gh-pr/13/head into gh-pr/13/base 2026-11-26 08:40:26 +00:00
Owner

@⁠wavehs on GitHub · 2026-11-24 01:39 UTC · original
wavehs:tests-viewer-vm-globals → main · +5 −0 · 1 files · 1 commits · merged 2026-11-24 02:26 UTC

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.)
**@⁠wavehs** on GitHub · 2026-11-24 01:39 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/13) `wavehs:tests-viewer-vm-globals` → `main` · +5 −0 · 1 files · 1 commits · merged 2026-11-24 02:26 UTC 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.)
viewer/index.html calls loadWorld() at module scope, which creates an
AbortController and arms a setTimeout. This test's vm context provides
neither, so the Shift/Ctrl camera test died with 'AbortController is
not defined' (setTimeout next once it is added), and the viewer-tests
job fails on every PR: Node 24's vm context has only what the sandbox
gives it, as Node 20's does here. The globals are now in the sandbox,
with timers that never fire since the manifest has no chunks.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:40:24 +00:00
github manually merged commit 1ffabec455 into gh-pr/13/base 2026-11-26 08:40:26 +00:00
Author
Owner

@⁠wavehs on GitHub · 2026-11-24 02:18 UTC · original

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).

**@⁠wavehs** on GitHub · 2026-11-24 02:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/13#issuecomment-7119994591) 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.