Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
- uses: actions/checkout@v4

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
uses: supercharge/mongodb-github-action@1.12.0
with:
mongodb-version: '6.0'
mongodb-version: '8.0'
mongodb-replica-set: test-rs

- name: Setup Node.js
Expand Down Expand Up @@ -117,9 +117,9 @@ jobs:
-d postgres:${{ matrix.postgres-version }}

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
uses: supercharge/mongodb-github-action@1.12.0
with:
mongodb-version: '6.0'
mongodb-version: '8.0'
mongodb-replica-set: test-rs

- name: Setup Node.js
Expand Down Expand Up @@ -183,9 +183,9 @@ jobs:
--server-id=1

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
uses: supercharge/mongodb-github-action@1.12.0
with:
mongodb-version: '6.0'
mongodb-version: '8.0'
mongodb-replica-set: test-rs

- name: Start PostgreSQL (Storage)
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
- uses: actions/checkout@v4

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
uses: supercharge/mongodb-github-action@1.12.0
with:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: test-rs
Expand Down
13 changes: 8 additions & 5 deletions modules/module-postgres/test/src/checkpoints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { checkpointUserId, createWriteCheckpoint } from '@powersync/service-core
import { describe, test } from 'vitest';
import { INITIALIZED_MONGO_STORAGE_FACTORY } from './util.js';
import { WalStreamTestContext } from './wal_stream_utils.js';
import { env } from './env.js';

import timers from 'node:timers/promises';

Expand All @@ -11,8 +12,8 @@ const BASIC_SYNC_RULES = `bucket_definitions:
data:
- SELECT id, description, other FROM "test_data"`;

describe('checkpoint tests', () => {
test('write checkpoints', { timeout: 30_000 }, async () => {
describe.skipIf(!(env.CI || env.SLOW_TESTS))('checkpoint tests', () => {
test('write checkpoints', { timeout: 50_000 }, async () => {
const factory = INITIALIZED_MONGO_STORAGE_FACTORY;
await using context = await WalStreamTestContext.open(factory);

Expand Down Expand Up @@ -58,10 +59,12 @@ describe('checkpoint tests', () => {

const start = Date.now();
while (lastWriteCheckpoint == null || lastWriteCheckpoint < BigInt(cp.writeCheckpoint)) {
if (Date.now() - start > 2_000) {
throw new Error(`Timeout while waiting for checkpoint`);
if (Date.now() - start > 5_000) {
throw new Error(
`Timeout while waiting for checkpoint. last: ${lastWriteCheckpoint}, waiting for: ${cp.writeCheckpoint}`
);
}
await timers.setTimeout(0, undefined, { signal: controller.signal });
await timers.setTimeout(5, undefined, { signal: controller.signal });
}
}
} finally {
Expand Down