@@ -2,12 +2,12 @@ import { MissingReplicationSlotError } from '@module/replication/WalStream.js';
22import { storage } from '@powersync/service-core' ;
33import { METRICS_HELPER , putOp , removeOp } from '@powersync/service-core-tests' ;
44import { pgwireRows } from '@powersync/service-jpgwire' ;
5+ import { JSONBig } from '@powersync/service-jsonbig' ;
56import { ReplicationMetric } from '@powersync/service-types' ;
67import * as crypto from 'crypto' ;
7- import { afterAll , beforeAll , describe , expect , test } from 'vitest' ;
8+ import { describe , expect , test } from 'vitest' ;
89import { describeWithStorage } from './util.js' ;
910import { WalStreamTestContext , withMaxWalSize } from './wal_stream_utils.js' ;
10- import { JSONBig } from '@powersync/service-jsonbig' ;
1111
1212const BASIC_SYNC_RULES = `
1313bucket_definitions:
@@ -328,18 +328,8 @@ bucket_definitions:
328328 // In the service, this error is handled in WalStreamReplicationJob,
329329 // creating a new replication slot.
330330 await expect ( async ( ) => {
331- try {
332- await context . replicateSnapshot ( ) ;
333- await context . getCheckpoint ( ) ;
334- } catch ( e ) {
335- // replicateSnapshot can have a ReplicationAbortedError(cause: MissingReplicationSlotError).
336- // This is specific to tests - real replication will get the MissingReplicationSlotError directly.
337- if ( e ?. cause ) {
338- throw e . cause ;
339- } else {
340- throw e ;
341- }
342- }
331+ await context . replicateSnapshot ( ) ;
332+ await context . getCheckpoint ( ) ;
343333 } ) . rejects . toThrowError ( MissingReplicationSlotError ) ;
344334 }
345335 }
@@ -391,17 +381,7 @@ bucket_definitions:
391381 // The error is handled on a higher level, which triggers
392382 // creating a new replication slot.
393383 await expect ( async ( ) => {
394- try {
395- await context . replicateSnapshot ( ) ;
396- } catch ( e ) {
397- // replicateSnapshot can have a ReplicationAbortedError(cause: MissingReplicationSlotError).
398- // This is specific to tests - real replication will get the MissingReplicationSlotError directly.
399- if ( e ?. cause ) {
400- throw e . cause ;
401- } else {
402- throw e ;
403- }
404- }
384+ await context . replicateSnapshot ( ) ;
405385 } ) . rejects . toThrowError ( MissingReplicationSlotError ) ;
406386 }
407387 } ) ;
0 commit comments