Skip to content

Commit

Permalink
Ignore infinite timers in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Mar 5, 2025
1 parent 3b6aa41 commit 4551dfd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/internal-test-utils/internalAct.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ export async function serverAct<T>(scope: () => Thenable<T>): Thenable<T> {

// $FlowFixMe[cannot-resolve-name]: Flow doesn't know about global Jest object
const j = jest;
if (j.getTimerCount() > 0) {
// We have always one pending timer running that resets the Owner Stack limit.
if (j.getTimerCount() > 1) {
// There's a pending timer. Flush it now. We only do this in order to
// force Suspense fallbacks to display; the fact that it's a timer
// is an implementation detail. If there are other timers scheduled,
Expand Down

0 comments on commit 4551dfd

Please sign in to comment.