Copilot commented on code in PR #39957:
URL: https://github.com/apache/superset/pull/39957#discussion_r3207287419
##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx:
##########
@@ -37,7 +37,7 @@ import {
PluginFilterSelectQueryFormData,
} from './types';
-jest.useFakeTimers();
+jest.useFakeTimers({ advanceTimers: true });
Review Comment:
`jest.useFakeTimers(...)` is set at module scope, but later tests in this
file switch to `jest.useRealTimers()` (e.g., the boolean-value tests) without
switching back. This makes the timer mode order-dependent and can reintroduce
hangs when running a subset of tests. Consider scoping fake timers to the
specific `describe` blocks that need them (set in `beforeEach` / restore in
`afterEach`).
##########
superset-frontend/packages/superset-ui-core/src/components/Select/Select.test.tsx:
##########
@@ -1160,7 +1160,7 @@ test('does not fire onChange if the same value is
selected in single mode', asyn
// Reference for the bug this tests:
https://github.com/apache/superset/pull/33043#issuecomment-2809419640
test('typing and deleting the last character for a new option displays
correctly', async () => {
- jest.useFakeTimers();
+ jest.useFakeTimers({ advanceTimers: true });
Review Comment:
This test enables fake timers but relies on reaching the end of the test to
call `jest.useRealTimers()`. If an assertion throws earlier, the file can
remain in fake-timer mode and cause unrelated later tests to hang. Wrap the
fake-timer section in a `try/finally` (or move timer restoration to an
`afterEach`) so timers are always restored.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]