Skip to content

Commit d45c212

Browse files
committed
Workaround for tests.
1 parent 4a6a5ae commit d45c212

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,17 @@ bucket_definitions:
381381
// The error is handled on a higher level, which triggers
382382
// creating a new replication slot.
383383
await expect(async () => {
384-
await context.replicateSnapshot();
384+
try {
385+
await context.replicateSnapshot();
386+
} catch (e) {
387+
// replicateSnapshot can have a ReplicationAbortedError(cause: MissingReplicationSlotError).
388+
// This is specific to tests - real replication will get the MissingReplicationSlotError directly.
389+
if (e?.cause) {
390+
throw e.cause;
391+
} else {
392+
throw e;
393+
}
394+
}
385395
}).rejects.toThrowError(MissingReplicationSlotError);
386396
}
387397
});

0 commit comments

Comments
 (0)