Skip to content

Commit 909a504

Browse files
committed
fix: disable retry in background error tests to prevent timeout
The tests were timing out because when refetch() throws an error, the default retry mechanism (3 retries with exponential backoff) was being triggered. With fake timers, the retry delays weren't being advanced, causing the tests to hang. Adding retry: false to both tests disables retries and allows them to complete immediately after the error, which is appropriate for these tests that specifically check background error behavior.
1 parent 08a6f2b commit 909a504

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/query-core/src/__tests__/queryObserver.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,7 @@ describe('queryObserver', () => {
14101410
queryFn,
14111411
staleTime: 'static',
14121412
refetchOnWindowFocus: true,
1413+
retry: false,
14131414
})
14141415

14151416
const unsubscribe = observer.subscribe(() => undefined)
@@ -1451,6 +1452,7 @@ describe('queryObserver', () => {
14511452
queryFn,
14521453
staleTime: 1000,
14531454
refetchOnWindowFocus: true,
1455+
retry: false,
14541456
})
14551457

14561458
const unsubscribe = observer.subscribe(() => undefined)

0 commit comments

Comments
 (0)