You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jl...@apache.org on 2025/08/28 06:57:42 UTC
(superset) branch joe/fix-hanging-jest-part-2 created (now c4423657e7)
This is an automated email from the ASF dual-hosted git repository.
jli pushed a change to branch joe/fix-hanging-jest-part-2
in repository https://gitbox.apache.org/repos/asf/superset.git
at c4423657e7 fix(tests): Improve MessageChannel mocking to prevent worker force exits
This branch includes the following new commits:
new c4423657e7 fix(tests): Improve MessageChannel mocking to prevent worker force exits
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(superset) 01/01: fix(tests): Improve MessageChannel mocking to prevent worker force exits
Posted by jl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jli pushed a commit to branch joe/fix-hanging-jest-part-2
in repository https://gitbox.apache.org/repos/asf/superset.git
commit c4423657e747f1ebb1f78741f76f1b7f6de65cc2
Author: Joe Li <jo...@preset.io>
AuthorDate: Wed Aug 27 23:57:06 2025 -0700
fix(tests): Improve MessageChannel mocking to prevent worker force exits
Replace `delete` with `undefined` assignment for MessageChannel/MessagePort
to prevent open handles from causing Jest worker processes to force exit.
The `delete` approach only removed properties at setup time but didn't prevent
later restoration by modules that had cached MessageChannel references,
leading to MessagePort handles remaining open after test completion.
Setting to `undefined` ensures the property exists but is unusable throughout
the entire test lifecycle, preventing handle leaks while maintaining the
intended rc-overflow fallback to requestAnimationFrame.
Fixes worker force exit errors in test shard 4/8.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <no...@anthropic.com>
---
superset-frontend/spec/helpers/jsDomWithFetchAPI.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/spec/helpers/jsDomWithFetchAPI.ts b/superset-frontend/spec/helpers/jsDomWithFetchAPI.ts
index beff7da952..81279356c3 100644
--- a/superset-frontend/spec/helpers/jsDomWithFetchAPI.ts
+++ b/superset-frontend/spec/helpers/jsDomWithFetchAPI.ts
@@ -36,7 +36,7 @@ export default class FixJSDOMEnvironment extends JSDOMEnvironment {
// Forces rc-overflow to use requestAnimationFrame fallback instead
// Can be removed when rc-overflow properly cleans up MessagePorts in test environments
// See: https://github.com/apache/superset/pull/34871
- delete (this.global as any).MessageChannel;
- delete (this.global as any).MessagePort;
+ this.global.MessageChannel = undefined as any;
+ this.global.MessagePort = undefined as any;
}
}