@@ -231,6 +231,8 @@ describe('Multiple Instances', { sequential: true }, () => {
231231 expect ( secondDatabase . currentStatus . connected ) . false ;
232232 // connect the second database in order for it to have access to the sync service.
233233 secondDatabase . connect ( createTestConnector ( ) ) ;
234+ // Timing of this can be tricky due to the need for responding to a pending request.
235+ await vi . waitFor ( ( ) => expect ( secondDatabase . currentStatus . connecting ) . true ) ;
234236 // connect the first database - this will actually connect to the sync service.
235237 await connect ( ) ;
236238
@@ -241,7 +243,6 @@ describe('Multiple Instances', { sequential: true }, () => {
241243
242244 sharedMockSyncServiceTest (
243245 'should trigger uploads from last connected clients' ,
244- { timeout : Infinity } ,
245246 async ( { context : { database, openDatabase, connect, connector } } ) => {
246247 const secondDatabase = openDatabase ( ) ;
247248
@@ -288,7 +289,6 @@ describe('Multiple Instances', { sequential: true }, () => {
288289 // It should now upload from the second client
289290 await vi . waitFor ( ( ) => expect ( secondConnector . uploadData ) . toHaveBeenCalledOnce ( ) ) ;
290291 await new Promise ( ( resolve ) => setTimeout ( resolve , 5000 ) ) ;
291- debugger ;
292292 // Now disconnect and close the second client
293293 await secondDatabase . close ( ) ;
294294
0 commit comments