Skip to content

Commit 1ee8b98

Browse files
committed
Increase timeout
1 parent c06cafe commit 1ee8b98

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/react/tests/streams.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('stream hooks', () => {
4343
wrapper: testWrapper
4444
});
4545
expect(result.current).toBeNull();
46-
await waitFor(() => expect(result.current).not.toBeNull(), { timeout: 500, interval: 100 });
46+
await waitFor(() => expect(result.current).not.toBeNull(), { timeout: 1000, interval: 100 });
4747
expect(currentStreams()).toStrictEqual([{ name: 'a', params: null }]);
4848

4949
// Should drop subscription on unmount
@@ -57,25 +57,25 @@ describe('stream hooks', () => {
5757
});
5858
expect(result.current).toMatchObject({ isLoading: true });
5959
// Including the stream should subscribe.
60-
await waitFor(() => expect(currentStreams()).toHaveLength(1), { timeout: 500, interval: 100 });
60+
await waitFor(() => expect(currentStreams()).toHaveLength(1), { timeout: 1000, interval: 100 });
6161
expect(result.current).toMatchObject({ isLoading: true });
6262

6363
// Set last_synced_at for the subscription
6464
db.currentStatus = _testStatus;
6565
db.iterateListeners((l) => l.statusChanged?.(_testStatus));
6666

6767
// Which should eventually run the query.
68-
await waitFor(() => expect(result.current.data).toHaveLength(1), { timeout: 500, interval: 100 });
68+
await waitFor(() => expect(result.current.data).toHaveLength(1), { timeout: 1000, interval: 100 });
6969
});
7070

7171
it('unsubscribes on unmount', async () => {
7272
const { unmount } = renderHook(() => useQuery('SELECT 1', [], { streams: [{ name: 'a' }, { name: 'b' }] }), {
7373
wrapper: testWrapper
7474
});
75-
await waitFor(() => expect(currentStreams()).toHaveLength(2), { timeout: 500, interval: 100 });
75+
await waitFor(() => expect(currentStreams()).toHaveLength(2), { timeout: 1000, interval: 100 });
7676

7777
unmount();
78-
await waitFor(() => expect(currentStreams()).toHaveLength(0), { timeout: 500, interval: 100 });
78+
await waitFor(() => expect(currentStreams()).toHaveLength(0), { timeout: 1000, interval: 100 });
7979
});
8080

8181
it('handles stream parameter changes', async () => {
@@ -105,21 +105,21 @@ describe('stream hooks', () => {
105105
}
106106
);
107107

108-
await waitFor(() => expect(result.current.data).toHaveLength(1), { timeout: 500, interval: 100 });
108+
await waitFor(() => expect(result.current.data).toHaveLength(1), { timeout: 1000, interval: 100 });
109109

110110
// Adopt streams - this should reset back to loading
111111
streams = [{ name: 'a' }];
112112
act(() => streamUpdateListeners.forEach((cb) => cb()));
113113
expect(result.current).toMatchObject({ isLoading: true });
114114

115115
// ... and subscribe
116-
await waitFor(() => expect(currentStreams()).toHaveLength(1), { timeout: 500, interval: 100 });
116+
await waitFor(() => expect(currentStreams()).toHaveLength(1), { timeout: 1000, interval: 100 });
117117
expect(result.current).toMatchObject({ isLoading: true });
118118

119119
// update back to no streams
120120
streams = [];
121121
act(() => streamUpdateListeners.forEach((cb) => cb()));
122-
await waitFor(() => expect(currentStreams()).toHaveLength(0), { timeout: 500, interval: 100 });
122+
await waitFor(() => expect(currentStreams()).toHaveLength(0), { timeout: 1000, interval: 100 });
123123
});
124124
});
125125
});

0 commit comments

Comments
 (0)