Skip to content

Commit d968d39

Browse files
committed
Same workaround in different test.
1 parent d45c212 commit d968d39

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

modules/module-postgres/test/src/wal_stream.test.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,18 @@ bucket_definitions:
328328
// In the service, this error is handled in WalStreamReplicationJob,
329329
// creating a new replication slot.
330330
await expect(async () => {
331-
await context.replicateSnapshot();
332-
await context.getCheckpoint();
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+
}
333343
}).rejects.toThrowError(MissingReplicationSlotError);
334344
}
335345
}

0 commit comments

Comments
 (0)