@@ -1565,7 +1565,11 @@ bucket_definitions:
1565
1565
await batch . keepalive ( '6/0' ) ;
1566
1566
} ) ;
1567
1567
1568
- const result2 = await iter . next ( ) ;
1568
+ let result2 = await iter . next ( ) ;
1569
+ if ( result2 . value ?. base ?. lsn == '5/0' ) {
1570
+ // Events could arrive in a different order in some cases - this caters for it
1571
+ result2 = await iter . next ( ) ;
1572
+ }
1569
1573
expect ( result2 ) . toMatchObject ( {
1570
1574
done : false ,
1571
1575
value : {
@@ -1671,7 +1675,11 @@ bucket_definitions:
1671
1675
await batch . keepalive ( '6/0' ) ;
1672
1676
} ) ;
1673
1677
1674
- const result2 = await iter . next ( ) ;
1678
+ let result2 = await iter . next ( ) ;
1679
+ if ( result2 . value ?. base ?. lsn == '5/0' ) {
1680
+ // Events could arrive in a different order in some cases - this caters for it
1681
+ result2 = await iter . next ( ) ;
1682
+ }
1675
1683
expect ( result2 ) . toMatchObject ( {
1676
1684
done : false ,
1677
1685
value : {
@@ -1689,14 +1697,15 @@ bucket_definitions:
1689
1697
user_id : 'user1'
1690
1698
}
1691
1699
] ) ;
1692
- // We have to trigger a new keepalive after the checkpoint, at least to cover postgres storage.
1693
- // This is what is effetively triggered with RouteAPI.createReplicationHead().
1694
- // MongoDB storage doesn't explicitly need this anymore.
1695
1700
await bucketStorage . startBatch ( test_utils . BATCH_OPTIONS , async ( batch ) => {
1696
1701
await batch . keepalive ( '7/0' ) ;
1697
1702
} ) ;
1698
1703
1699
- const result3 = await iter . next ( ) ;
1704
+ let result3 = await iter . next ( ) ;
1705
+ if ( result3 . value ?. base ?. lsn == '6/0' ) {
1706
+ // Events could arrive in a different order in some cases - this caters for it
1707
+ result3 = await iter . next ( ) ;
1708
+ }
1700
1709
expect ( result3 ) . toMatchObject ( {
1701
1710
done : false ,
1702
1711
value : {
0 commit comments