mengw15 opened a new pull request, #6600: URL: https://github.com/apache/texera/pull/6600
### What changes were proposed in this PR? Frontend unit tests intermittently failed on CI with `RangeError: Maximum call stack size exceeded` in unrelated specs (e.g. `notification.service.spec.ts`, `filters-instructions.component.spec.ts`). The cause is in `frontend/src/test-zone-setup.ts`, which wraps Vitest's `it`/`test` so each spec body runs inside an Angular ProxyZone (needed for `fakeAsync`/`waitForAsync`). It forked a new ProxyZone from `Zone.current` for every test. When an async spec resolves, its continuation can leave the forked proxy as the current zone, so the next fork nests inside it; across the many spec files a Vitest worker runs, the proxy chain grows without bound and eventually overflows the stack inside the `ProxyZoneSpec.onInvoke -> _ZoneDelegate.invoke` delegate chain. Because the depth reached depends on how Vitest packs test files onto workers, the failure is flaky and OS-dependent (observed on `macos-latest` while `ubuntu-latest`/`windows-latest` pass on the same commit), and it can evict an otherwise-green PR from the merge queue. The fix aligns `test-zone-setup.ts` with zone.js's own framework integrations: fork a single ProxyZone from `Zone.root` once, reuse it for every test, and reset its delegate between tests. Forking from the root zone keeps the proxy exactly one level deep regardless of prior test state, so the chain can no longer grow. ### Any related issues, documentation, discussions? Closes #6593. ### How was this PR tested? Added `frontend/src/test-zone-setup.spec.ts`, which asserts the proxy is present and forked directly under the root zone (bounded depth) and that `fakeAsync`/`waitForAsync` still work through the wrapper. Ran all ProxyZone-sensitive specs (every `fakeAsync`/`waitForAsync` spec) locally with and without the change: the new tests pass and no existing test regresses. The flake is not deterministically reproducible from a single spec, so it is not reproduced as a unit test. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-4-8) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
