Context
data/TreeStoreValueBanding.spec.mjs:194 is one of the four intermittent arms #19039's instrument was built to measure. CI reported it as 1 flaky / 4259 passed on 2026-09-19. The instrument's first hosted probe on dev@526b65e0ee, --repeat-each=50 (35807579596), measured 1 flaky in 150:
Error: Namespace collision in unitTestMode for Test.Unit.Data.TreeStoreValueBanding.TestTreeModel
Locally, npm run test-unit -- …/TreeStoreValueBanding.spec.mjs --repeat-each=50 --workers=4 --retries=0 gives 3 failed / 147 passed, all three that same collision.
Sweeps: the latest 20 open issues at 2026-09-23T01:53:28Z hold no equivalent. There is no lane claim. The nearest prior art is #18776, a different unit-isolation leak, closed.
The Problem
The spec defines TestTreeModel inside its describe and registers it in test.beforeAll(() => { TestModel = Neo.setupClass(TestTreeModel); }), then never removes it. The unit config runs fullyParallel: true on 4 workers with 2 retries in CI. A worker can execute beforeAll more than once for this describe (repeats, or separate groups of its three tests). The second Neo.setupClass finds the namespace taken, and unitTestMode throws (src/Neo.mjs:875-882). The retry runs in a fresh worker and passes, so the report reads "flaky".
The Architectural Reality
Neo.setupClass in unitTestMode throws when a non-singleton re-registers a taken namespace. That is deliberate (src/Neo.mjs:869-874): two distinct classes sharing a name is a test-isolation leak.
- 85 unit spec files register their test classes at module scope, which runs once per worker process because modules are cached. This spec is the only one that registers inside
beforeAll.
The Fix
Register TestTreeModel at module scope, the idiom the other 85 files use: define the class and run Neo.setupClass once, outside beforeAll. No engine change.
Acceptance Criteria
Out of Scope
unitTestMode's collision rule. It is correct, and this spec broke it.
- The other three intermittent arms (#19039).
Decision Record impact
None.
Related
#19039 · #19043 · #18776
Origin Session ID: 19051047-2f38-4bf0-be51-efd6b957564d
Retrieval Hint: "Namespace collision in unitTestMode beforeAll setupClass fullyParallel repeat-each"
Context
data/TreeStoreValueBanding.spec.mjs:194is one of the four intermittent arms #19039's instrument was built to measure. CI reported it as1 flaky / 4259 passedon 2026-09-19. The instrument's first hosted probe ondev@526b65e0ee,--repeat-each=50(35807579596), measured 1 flaky in 150:Locally,
npm run test-unit -- …/TreeStoreValueBanding.spec.mjs --repeat-each=50 --workers=4 --retries=0gives 3 failed / 147 passed, all three that same collision.Sweeps: the latest 20 open issues at 2026-09-23T01:53:28Z hold no equivalent. There is no lane claim. The nearest prior art is #18776, a different unit-isolation leak, closed.
The Problem
The spec defines
TestTreeModelinside itsdescribeand registers it intest.beforeAll(() => { TestModel = Neo.setupClass(TestTreeModel); }), then never removes it. The unit config runsfullyParallel: trueon 4 workers with 2 retries in CI. A worker can executebeforeAllmore than once for thisdescribe(repeats, or separate groups of its three tests). The secondNeo.setupClassfinds the namespace taken, andunitTestModethrows (src/Neo.mjs:875-882). The retry runs in a fresh worker and passes, so the report reads "flaky".The Architectural Reality
Neo.setupClassinunitTestModethrows when a non-singleton re-registers a taken namespace. That is deliberate (src/Neo.mjs:869-874): two distinct classes sharing a name is a test-isolation leak.beforeAll.The Fix
Register
TestTreeModelat module scope, the idiom the other 85 files use: define the class and runNeo.setupClassonce, outsidebeforeAll. No engine change.Acceptance Criteria
--repeat-each=50 --workers=4 --retries=0on the spec: 0 failed, 150 passed.beforeAllrestores the collision under the same command.Out of Scope
unitTestMode's collision rule. It is correct, and this spec broke it.Decision Record impact
None.
Related
#19039 · #19043 · #18776
Origin Session ID: 19051047-2f38-4bf0-be51-efd6b957564d
Retrieval Hint: "Namespace collision in unitTestMode beforeAll setupClass fullyParallel repeat-each"