diff --git a/UPDATING.md b/UPDATING.md index a175f7f440bb..08cd483775e0 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -23,6 +23,7 @@ This file documents any backwards-incompatible changes in Superset and assists people when migrating to a new version. ## Next +- [34871](https://github.com/apache/superset/pull/34871): Fixed Jest test hanging issue from Ant Design v5 upgrade. MessageChannel is now mocked in test environment to prevent rc-overflow from causing Jest to hang. Test environment only - no production impact. - [34782](https://github.com/apache/superset/pull/34782): Dataset exports now include the dataset ID in their file name (similar to charts and dashboards). If managing assets as code, make sure to rename existing dataset YAMLs to include the ID (and avoid duplicated files). - [34536](https://github.com/apache/superset/pull/34536): The `ENVIRONMENT_TAG_CONFIG` color values have changed to support only Ant Design semantic colors. Update your `superset_config.py`: - Change `"error.base"` to just `"error"` after this PR diff --git a/docs/docs/contributing/development.mdx b/docs/docs/contributing/development.mdx index ee38ca763490..c811177624b5 100644 --- a/docs/docs/contributing/development.mdx +++ b/docs/docs/contributing/development.mdx @@ -747,6 +747,26 @@ To run a single test file: npm run test -- path/to/file.js ``` +#### Known Issues and Workarounds + +**Jest Test Hanging (MessageChannel Issue)** + +If Jest tests hang with "Jest did not exit one second after the test run has completed", this is likely due to the MessageChannel issue from rc-overflow (Ant Design v5 components). + +**Root Cause**: `rc-overflow@1.4.1` creates MessageChannel handles for responsive overflow detection that remain open after test completion. + +**Current Workaround**: MessageChannel is mocked as undefined in `spec/helpers/jsDomWithFetchAPI.ts`, forcing rc-overflow to use requestAnimationFrame fallback. + +**To verify if still needed**: Remove the MessageChannel mocking lines and run `npm test -- --shard=4/8`. If tests hang, the workaround is still required. + +**Future removal conditions**: This workaround can be removed when: +- rc-overflow updates to properly clean up MessagePorts in test environments +- Jest updates to handle MessageChannel/MessagePort cleanup better +- Ant Design switches away from rc-overflow +- We switch away from Ant Design v5 + +**See**: [PR #34871](https://github.com/apache/superset/pull/34871) for full technical details. + ### Debugging Server App #### Local diff --git a/superset-frontend/spec/helpers/jsDomWithFetchAPI.ts b/superset-frontend/spec/helpers/jsDomWithFetchAPI.ts index c1c1238e76e0..beff7da95271 100644 --- a/superset-frontend/spec/helpers/jsDomWithFetchAPI.ts +++ b/superset-frontend/spec/helpers/jsDomWithFetchAPI.ts @@ -31,5 +31,12 @@ export default class FixJSDOMEnvironment extends JSDOMEnvironment { this.global.Response = Response; this.global.AbortSignal = AbortSignal; this.global.AbortController = AbortController; + + // Mock MessageChannel to prevent hanging Jest tests with rc-overflow@1.4.1 + // 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; } }