File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
modules/module-postgres/test/src Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,11 @@ bucket_definitions:
9696 ) ;
9797 await pool . query ( `ALTER TABLE test_data REPLICA IDENTITY FULL` ) ;
9898
99- await walStream . initReplication ( ) ;
10099 let abort = false ;
101- streamPromise = walStream . streamChanges ( ) . finally ( ( ) => {
100+ streamPromise = walStream . replicate ( ) . finally ( ( ) => {
102101 abort = true ;
103102 } ) ;
103+ await walStream . waitForInitialSnapshot ( ) ;
104104 const start = Date . now ( ) ;
105105
106106 while ( ! abort && Date . now ( ) - start < TEST_DURATION_MS ) {
@@ -344,17 +344,12 @@ bucket_definitions:
344344
345345 // 3. Start initial replication, then streaming, but don't wait for any of this
346346 let initialReplicationDone = false ;
347- streamPromise = ( async ( ) => {
348- await walStream . initReplication ( ) ;
349- initialReplicationDone = true ;
350- await walStream . streamChanges ( ) ;
351- } ) ( )
352- . catch ( ( e ) => {
347+ streamPromise = walStream . replicate ( ) ;
348+ walStream
349+ . waitForInitialSnapshot ( )
350+ . catch ( ( _ ) => { } )
351+ . finally ( ( ) => {
353352 initialReplicationDone = true ;
354- throw e ;
355- } )
356- . then ( ( v ) => {
357- return v ;
358353 } ) ;
359354
360355 // 4. While initial replication is still running, write more changes
You can’t perform that action at this time.
0 commit comments