Frontmatter
| id | 8830 |
| title | Stabilize VDOM Unit Tests: Eliminate ID Collisions in Parallel Execution |
| state | Closed |
| labels | airefactoringtesting |
| assignees | tobiu |
| createdAt | Jan 20, 2026, 5:12 PM |
| updatedAt | Jan 20, 2026, 5:18 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8830 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 20, 2026, 5:18 PM |
Stabilize VDOM Unit Tests: Eliminate ID Collisions in Parallel Execution
tobiu assigned to @tobiu on Jan 20, 2026, 5:17 PM

tobiu
Jan 20, 2026, 5:17 PM
Input from Gemini 3 Pro:
✦ I have refactored
RaceCondition.spec.mjsandTreeBuilder.spec.mjsto use dynamic, unique IDs for all test components.Changes:
- Implemented a
getUniqueIdhelper in test files.- Replaced hardcoded IDs (e.g., 'child-1') with generated ones (e.g., 'child-1-1705...').
- Updated teardown logic to track and destroy these dynamically named components.
Verification:
npm run test-unitnow passes 240/240 tests consistently with 8 workers, and the ID collision errors are gone.
tobiu closed this issue on Jan 20, 2026, 5:18 PM
This ticket addresses the instability of the VDOM unit test suite when running with multiple workers (parallel execution).
The Problem: Running
npm run test-unitresulted in sporadic failures and numerous[Base.mjs] Trying to create an item with an already existing iderrors. This was caused by several test files (specificallyRaceCondition.spec.mjsandTreeBuilder.spec.mjs) using hardcoded component IDs (e.g.,'child-1','test-container'). When Playwright executed these tests in parallel or reused workers without perfect cleanup, these IDs collided, leading to cross-test pollution and failures.The Solution: Refactor the affected test files to use dynamic, unique IDs for all components created during testing.
${prefix}-${timestamp}-${counter}).RaceCondition.spec.mjsandTreeBuilder.spec.mjsto use these dynamic IDs.test.afterEach.Outcome: The full unit test suite now passes consistently with 8 workers, with no ID collision errors.