Skip to content

Dispose stray validation scenes after every test - #1923

Merged
bkaradzic-microsoft merged 1 commit into
BabylonJS:masterfrom
bkaradzic-microsoft:pr/unconditional-stray-scene-cleanup
Oct 8, 2026
Merged

bkaradzic-microsoft merged 1 commit into
BabylonJS:masterfrom
bkaradzic-microsoft:pr/unconditional-stray-scene-cleanup

Conversation

@bkaradzic-microsoft

Copy link
Copy Markdown
Member

Follow-up to #1920, addressing #1920 (comment).

#1920 moved stray-scene disposal behind the leak-cleanup workaround. If a test fails before currentScene is assigned (for example, wait-for-import rejects for the OpenPBR test), the scene it created stayed registered on the reused engine and could affect later tests.

  • cleanupAfterTest disposes engine.scenes after every test again, as it did before Key validation example workarounds per test in config.json #1920.
  • leak-cleanup now covers only the texture-cache release and the Draco reset. Stray scenes no longer count toward its "applied" log, because that disposal is now unconditional.
  • Updated the workaround description in validation_native.js and Documentation/AddingNewValidationTests.md.

Validated locally on Win32 D3D11 with Draco Mesh Compression (fallback), GLTF Serializer KHR gpu instancing, and OpenPBR Transmission Roughness vs IOR - Analytic Lights.

BabylonJS#1920 moved stray-scene disposal behind the leak-cleanup workaround. When a
test fails before currentScene is assigned (for example, wait-for-import
rejects for the OpenPBR test), the scene it created was left on the reused
engine for later tests. Dispose engine.scenes unconditionally again and keep
only the texture-cache release and Draco reset behind leak-cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 97f1ddbf-b571-4a6c-8cb3-411b37e0d15a
Copilot AI balanced review requested due to automatic review settings October 8, 2026 21:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused changes correctly restore unconditional scene isolation and align the workaround documentation with the implementation.

0 open findings

What changed in this PR

Restores unconditional cleanup of stray validation scenes to prevent failed tests from contaminating later tests.

Changes:

  • Disposes all remaining engine scenes after every test.
  • Restricts leak-cleanup to texture and Draco state cleanup.
  • Updates workaround documentation.
File Description
Apps/​Playground/​Scripts/​validation_native.js Moves stray-scene disposal into unconditional test cleanup.
Documentation/​AddingNewValidationTests.md Documents the revised cleanup behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bkaradzic-microsoft
bkaradzic-microsoft merged commit 5f5b2e6 into BabylonJS:master Oct 8, 2026
35 checks passed
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.

4 participants