From 2f5cd155b96d84206c231abf26bb257c579062af Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Mon, 30 Mar 2026 16:38:21 -0700 Subject: [PATCH 1/3] Match exact URLs in waitUntil predicate, not just count The predicate only checked that the coalesced job had the expected number of URLs, which could match early with the wrong set. Compare the sorted URL lists so the wait continues until the correct URLs are present. Co-Authored-By: Claude Opus 4.6 (1M context) --- packages/realm-server/tests/indexing-test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/realm-server/tests/indexing-test.ts b/packages/realm-server/tests/indexing-test.ts index 5d620c595ce..2908295fc39 100644 --- a/packages/realm-server/tests/indexing-test.ts +++ b/packages/realm-server/tests/indexing-test.ts @@ -1496,7 +1496,10 @@ module(basename(__filename), function () { let urls = rows[0].args.changes .map((change) => change.url) .sort(); - return urls.length === expectedUrls.length ? rows[0] : undefined; + return urls.length === expectedUrls.length && + urls.every((url, i) => url === expectedUrls[i]) + ? rows[0] + : undefined; }, { timeout: 3000, From 9ef33fa11e2b4343b5a14069b9f9e74bfd7ea9df Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Mon, 30 Mar 2026 16:38:31 -0700 Subject: [PATCH 2/3] Use matrix.shardTotal instead of hardcoded shard count Avoids drift if the shard count is changed in the matrix definition. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eee80bdf886..b4de1b1e7f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -516,7 +516,7 @@ jobs: cp -a .test-web-assets-artifact/. ./ - name: Compute shard test modules id: shard_modules - run: echo "modules=$(node scripts/shard-test-modules.js ${{ matrix.shardIndex }} 6)" >> "$GITHUB_OUTPUT" + run: echo "modules=$(node scripts/shard-test-modules.js ${{ matrix.shardIndex }} ${{ matrix.shardTotal }})" >> "$GITHUB_OUTPUT" working-directory: packages/realm-server - name: Start test services (icons + host dist + realm servers) run: mise run test-services:realm-server | tee -a /tmp/server.log & From de14eafcbda9dfe5c5f6b0569889fa3e17dcb0cb Mon Sep 17 00:00:00 2001 From: Buck Doyle Date: Mon, 30 Mar 2026 16:38:47 -0700 Subject: [PATCH 3/3] Use bash array for JUNIT_REPORTER_ARGS to avoid word-splitting issues The string-based approach relied on word-splitting and would break if the workspace path contained spaces. Use an array and expand with "${arr[@]}" for safe argument passing. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../realm-server/tests/scripts/run-qunit-with-test-pg.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/realm-server/tests/scripts/run-qunit-with-test-pg.sh b/packages/realm-server/tests/scripts/run-qunit-with-test-pg.sh index 1c41f9c8d8b..df152cffe68 100755 --- a/packages/realm-server/tests/scripts/run-qunit-with-test-pg.sh +++ b/packages/realm-server/tests/scripts/run-qunit-with-test-pg.sh @@ -14,9 +14,9 @@ else EFFECTIVE_LOG_LEVELS="$BASE_LOG_LEVELS" fi -JUNIT_REPORTER_ARGS="" +JUNIT_REPORTER_ARGS=() if [ -n "${JUNIT_OUTPUT_FILE-}" ]; then - JUNIT_REPORTER_ARGS="--require ${SCRIPT_DIR}/../../scripts/junit-reporter.js" + JUNIT_REPORTER_ARGS=(--require "${SCRIPT_DIR}/../../scripts/junit-reporter.js") fi LOG_LEVELS="$EFFECTIVE_LOG_LEVELS" \ @@ -24,4 +24,4 @@ NODE_NO_WARNINGS=1 \ PGPORT=55436 \ STRIPE_WEBHOOK_SECRET=stripe-webhook-secret \ STRIPE_API_KEY=stripe-api-key \ -qunit --require ts-node/register/transpile-only $JUNIT_REPORTER_ARGS "$@" tests/index.ts +qunit --require ts-node/register/transpile-only "${JUNIT_REPORTER_ARGS[@]}" "$@" tests/index.ts