Skip to content

Commit 1c85ca2

Browse files
committed
More test fixes.
1 parent 1d0088f commit 1c85ca2

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { METRICS_HELPER, test_utils } from '@powersync/service-core-tests';
1919
import * as mongo_storage from '@powersync/service-module-mongodb-storage';
2020
import * as postgres_storage from '@powersync/service-module-postgres-storage';
2121
import * as timers from 'node:timers/promises';
22-
import { CustomTypeRegistry } from '@module/types/registry.js';
22+
import { ReplicationAbortedError } from '@powersync/lib-services-framework';
2323

2424
describe.skipIf(!(env.CI || env.SLOW_TESTS))('slow tests', function () {
2525
describeWithStorage({ timeout: 120_000 }, function (factory) {
@@ -42,7 +42,7 @@ function defineSlowTests(factory: storage.TestStorageFactory) {
4242
// This cleans up, similar to WalStreamTestContext.dispose().
4343
// These tests are a little more complex than what is supported by WalStreamTestContext.
4444
abortController?.abort();
45-
await streamPromise;
45+
await streamPromise?.catch((_) => {});
4646
streamPromise = undefined;
4747
connections?.destroy();
4848

@@ -287,7 +287,13 @@ bucket_definitions:
287287
}
288288

289289
abortController.abort();
290-
await streamPromise;
290+
await streamPromise.catch((e) => {
291+
if (e instanceof ReplicationAbortedError) {
292+
// Ignore
293+
} else {
294+
throw e;
295+
}
296+
});
291297
}
292298

293299
// Test repeatedly performing initial replication.
@@ -392,7 +398,13 @@ bucket_definitions:
392398
}
393399

394400
abortController.abort();
395-
await streamPromise;
401+
await streamPromise.catch((e) => {
402+
if (e instanceof ReplicationAbortedError) {
403+
// Ignore
404+
} else {
405+
throw e;
406+
}
407+
});
396408
await connections.end();
397409
}
398410
});

0 commit comments

Comments
 (0)