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 <j...@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 <nore...@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;
   }
 }

Reply via email to