From d9528e6bd22cbf9281d39a8f709f3c142f04b632 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Mon, 9 Nov 2026 14:13:31 +0000 Subject: [PATCH 1/7] ci: run only the MongoDB-backed Rust tests in mongodb-rust mongodb-rust passed --rust to run-mongodb-tests, which runs the whole workspace's `cargo test` against the job's server. On main's push run for 76b9710dc that took 11 minutes. Building the workspace's test binaries took 3 min 54 s, and running every crate's tests took 7 minutes. The Test workflow runs the same tests on stable and on 1.88. The job now passes only --rust-integration. The tests that need MongoDB still run against a replica set: - records_live and the five migration test files run in the storage-level sections of run-mongodb-tests. Their condition now names both Rust suites. - The data_engine and backup_engine live tests and the restore fence cells run under --rust-live. - The snapshot_engine tests run in mongodb-snapshot, with EXTENDDB_TEST_MONGODB_REQUIRED set. No other workspace test reads EXTENDDB_TEST_MONGODB_URI. --- .github/workflows/integration-mongodb.yml | 8 +++++++- devtools/run-mongodb-tests | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-mongodb.yml b/.github/workflows/integration-mongodb.yml index 83708ef5f..197e48fbb 100644 --- a/.github/workflows/integration-mongodb.yml +++ b/.github/workflows/integration-mongodb.yml @@ -190,7 +190,13 @@ jobs: # run-mongodb-tests gives the server a filesystem [backup.store]: # the Rust backup tests restore the store-backed job's backups. EXTENDDB_TEST_BACKUP_STORE: filesystem - run: devtools/run-mongodb-tests --rust-live -- --rust --rust-integration + # No --rust: it runs the whole workspace's `cargo test`, which the Test + # workflow runs on two toolchains. For --rust-integration, + # run-mongodb-tests still runs the storage-mongodb tests that need this + # replica set (records_live and the migration tests), and --rust-live + # runs the crate's other live tests. mongodb-snapshot runs the + # snapshot_engine tests. + run: devtools/run-mongodb-tests --rust-live -- --rust-integration # The store-backed CreateBackup on MongoDB: a server with a filesystem # store, the backup selection of the pytest suite with diff --git a/devtools/run-mongodb-tests b/devtools/run-mongodb-tests index 57eaba215..0c410676e 100755 --- a/devtools/run-mongodb-tests +++ b/devtools/run-mongodb-tests @@ -343,7 +343,11 @@ fi # --------------------------------------------------------------------------- echo "" -if [[ " ${RUN_TESTS_ARGS[*]} " == *" --rust"* ]]; then +# These two sections run for either Rust suite. CI's mongodb-rust job passes +# only --rust-integration, so they are where it runs the storage-mongodb tests +# that need this replica set. +if [[ " ${RUN_TESTS_ARGS[*]} " == *" --rust "* \ + || " ${RUN_TESTS_ARGS[*]} " == *" --rust-integration "* ]]; then # The storage-level MongoDB tests that need a live server (the stream # records page over 16 MB and the shard ownership predicates) are # #[ignore]d in the crate and read their server from this variable; this From 42ba2fbc842d8c03f94394d9f0cc2f968a86c542 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Mon, 9 Nov 2026 15:46:45 +0000 Subject: [PATCH 2/7] ci: say when the MongoDB storage-level sections run The comment said that the records_live and migration sections of run-mongodb-tests run for either Rust suite. They run when the arguments name --rust or --rust-integration, and not for --all, which run-tests expands to both suites. The comment now says so, and it names the tests that mongodb-rust runs in these sections. --- devtools/run-mongodb-tests | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/devtools/run-mongodb-tests b/devtools/run-mongodb-tests index 0c410676e..b0ac97cb7 100755 --- a/devtools/run-mongodb-tests +++ b/devtools/run-mongodb-tests @@ -343,9 +343,10 @@ fi # --------------------------------------------------------------------------- echo "" -# These two sections run for either Rust suite. CI's mongodb-rust job passes -# only --rust-integration, so they are where it runs the storage-mongodb tests -# that need this replica set. +# These two sections run when the arguments name --rust or --rust-integration. +# They do not run for --all, which run-tests expands to both suites. CI's +# mongodb-rust job passes --rust-integration, so these sections are where it +# runs records_live and the migration tests. if [[ " ${RUN_TESTS_ARGS[*]} " == *" --rust "* \ || " ${RUN_TESTS_ARGS[*]} " == *" --rust-integration "* ]]; then # The storage-level MongoDB tests that need a live server (the stream From d833c7175d424419648bb5397e57217094cf9606 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Mon, 9 Nov 2026 19:14:54 +0000 Subject: [PATCH 3/7] ci: stop repeating the backup suites on every integration shard On the CI run of d9528e6bd (run 42637473269), every shard of run-integration and run-integration-sqlite ran tests/test_backup_store_config.py and tests/test_backup_job.py by name. The two files took 2 min 52 s to 3 min 8 s on each PostgreSQL shard. The S3 mock took 22 to 28 s more. On each SQLite shard the two files took 4 min 28 s to 4 min 30 s. Each SQLite shard also ran the store configuration suite a second time inside devtools/run-tests, against an S3 mock of its own. That run took 2 min 45 s to 2 min 46 s. - PostgreSQL: the new run-integration-backup job runs the two files once, with the shards' PostgreSQL service, the S3 mock and the same environment. The integration job needs it. The CLI lifecycle list of devtools/run-tests still runs the store configuration suite's PostgreSQL cells on one shard. - SQLite: the shards run neither file. devtools/run-tests skips its SQLite backup store block in a run with --shard. The shards no longer start the S3 mock, whose one reader was that block. run-integration-sqlite-s3 runs both files on the same build with the S3 mock. On run 42637473269 it passed every test that a SQLite shard passed in either of those runs. The timeout comments give the measured times and the projected time of a shard. --- .github/workflows/integration.yml | 156 ++++++++++++++++++------------ devtools/run-tests | 38 +++++--- 2 files changed, 118 insertions(+), 76 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 071500c00..0deca4434 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -87,10 +87,12 @@ jobs: # rather than "latest" because ubuntu-latest migrates to 26.04 in Oct–Nov # 2026 and this compiles Rust; move to 26 deliberately. runs-on: extenddb_ubuntu-2404_4-core - # With the backup store and job suites it ends with (3 min 3 s of it), the - # job took 39 min 49 s on #740's CI, at the old 40-minute bound. With the - # PartiQL wire tests it took 48 min 4 s on #411's CI, before #740. A run - # with both should take about 50 min; 70 leaves room for a slow runner. + # On #911's CI (run 42637473269) the three shards took 16 min 52 s to + # 18 min 14 s. Of that, 3 min 14 s to 3 min 32 s went to the backup store + # and job suites and their S3 mock, which run-integration-backup now runs + # once per run, so a shard should take 13 min 38 s to 14 min 44 s. 70 is + # the bound of the unsharded job (39 min 49 s on #740's CI, 48 min 4 s + # with the PartiQL wire tests on #411's) and leaves room for a slow runner. timeout-minutes: 70 needs: build-postgres # Three shards by test file (devtools/test-shards); the integration job @@ -245,6 +247,74 @@ jobs: EXTENDDB_TEST_BACKUP_STORE: filesystem run: devtools/run-tests --extenddb --pytest --comprehensive --terraform --parallel --filter "not import_export" + # run-tests restarts the server daemonized to apply the import/export + # config, and a daemonized server logs to syslog, not the job log. Without + # this dump, the storage error behind a client-visible 500 leaves no + # evidence anywhere in CI. + - name: Dump server syslog on failure + if: failure() + run: sudo journalctl -t extenddb --no-pager -n 500 || true + + # The integration job checks these lists. + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: shards-run-integration-${{ matrix.shard }} + path: discussions/shards/ + if-no-files-found: warn + retention-days: 1 + # A re-run of a failed job uploads the same name again. + overwrite: true + + # The backup store and job suites on the PostgreSQL build, by name, once + # per run. Both start servers of their own (the store configuration suite + # on a catalog database it creates per test, the job suite on deployments + # of its own), so they need the binary, the PostgreSQL service and moto, + # not the shards' server. run-tests' main suite excludes them. Its CLI + # lifecycle list still runs the store configuration suite's PostgreSQL + # cells on one shard, without moto. run-integration-sqlite-s3 runs the two + # files on the SQLite build. + run-integration-backup: + runs-on: extenddb_ubuntu-2404_4-core + # On each shard of #911's CI (run 42637473269) the suites took 2 min 52 s + # to 3 min 8 s and the S3 mock 22 to 28 s. With about 30 s of job setup, + # the PostgreSQL container's start, checkout, download and pip install, + # the job should take about 4 min. 15 leaves room for a slow runner. + timeout-minutes: 15 + needs: build-postgres + services: + postgres: + # The shards' image, so the suites' servers run against the same + # PostgreSQL. + image: pgvector/pgvector:pg16 + env: + POSTGRES_PASSWORD: devpass + options: >- + --health-cmd "pg_isready -U postgres" + --health-interval 5s + --health-timeout 5s + --health-retries 5 + ports: + - 127.0.0.1:5432:5432 + + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 + + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: extenddb-postgres + path: target/release + + # Artifacts do not keep file modes. + - run: chmod +x target/release/extenddb + + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + with: + python-version: "3.12" + + - name: Install Python dependencies + run: pip install -r requirements.txt + # moto for the job suite's store-outage cell, the one cell that # exercises `spool_path` on PostgreSQL (an S3 download into the spool, # the retry under a cut, the spool entry removed); without the endpoint @@ -260,8 +330,6 @@ jobs: done echo "moto_server did not start"; cat moto.log; exit 1 - # The backup store and job suites start servers of their own, so they - # are excluded from run-tests' line and run by name. - name: Run the backup store and job suites env: EXTENDDB_TEST_PG_CONNECTION_STRING: postgresql://postgres:devpass@127.0.0.1:5432 @@ -269,35 +337,22 @@ jobs: EXTENDDB_TEST_S3_ENDPOINT: http://127.0.0.1:9000 run: python3 -m pytest tests/test_backup_store_config.py tests/test_backup_job.py -v -rP -p no:cacheprovider + # The suites' servers run in the foreground and log to files the cells + # quote in their assertions, so there is no syslog to dump here. - name: Print the S3 mock's log if: failure() run: cat moto.log || true - # run-tests restarts the server daemonized to apply the import/export - # config, and a daemonized server logs to syslog, not the job log. Without - # this dump, the storage error behind a client-visible 500 leaves no - # evidence anywhere in CI. - - name: Dump server syslog on failure - if: failure() - run: sudo journalctl -t extenddb --no-pager -n 500 || true - - # The integration job checks these lists. - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: always() - with: - name: shards-run-integration-${{ matrix.shard }} - path: discussions/shards/ - if-no-files-found: warn - retention-days: 1 - # A re-run of a failed job uploads the same name again. - overwrite: true - run-integration-sqlite: runs-on: extenddb_ubuntu-2404_4-core - # With the backup store and job suites it ends with (4 min 16 s of it), the - # job took 40 min 31 s on #740's CI, past the old 40-minute bound. With the - # PartiQL wire tests it took 43 min 27 s on #411's CI, before #740. 60 - # leaves room for both and a slow runner. + # On #911's CI (run 42637473269) the three shards took 20 min 6 s to + # 21 min 52 s. Of that, 4 min 28 s to 4 min 30 s went to the backup store + # and job suites run by name, 2 min 45 s to 2 min 46 s to run-tests' run + # of the store configuration suite, and 25 to 28 s to the S3 mock it + # used. The shards now run neither file (run-integration-sqlite-s3 runs + # both), so a shard should take 12 min 26 s to 14 min 7 s. 60 is the + # bound of the unsharded job (40 min 31 s on #740's CI, 43 min 27 s with + # the PartiQL wire tests on #411's) and leaves room for a slow runner. timeout-minutes: 60 needs: build-sqlite strategy: @@ -389,25 +444,9 @@ jobs: - name: Install Python dependencies run: pip install -r requirements.txt - # Local S3 endpoint for tests/test_backup_store_config.py's S3 cells - # (an S3 store's /health against an endpoint that refuses, stalls and - # recovers), which devtools/run-tests runs on a SQLite build after the - # main suite. Same moto as the unit-test workflow, pinned in - # requirements-moto.txt, installed into a virtualenv of its own: its - # boto3 and botocore pins differ from requirements.txt's, and the - # suite keeps running on the environment installed above. On port - # 9200, clear of the server's. - - name: Start S3 mock - run: | - python -m venv "$RUNNER_TEMP/moto-venv" - "$RUNNER_TEMP/moto-venv/bin/pip" install -r requirements-moto.txt - nohup "$RUNNER_TEMP/moto-venv/bin/moto_server" -p 9200 > moto.log 2>&1 & - for _ in $(seq 1 30); do - if curl -sf http://127.0.0.1:9200/ > /dev/null; then exit 0; fi - sleep 1 - done - echo "moto_server did not start"; cat moto.log; exit 1 - + # No S3 mock here: its one reader on a shard was run-tests' run of + # tests/test_backup_store_config.py, which a sharded run skips. + # run-integration-sqlite-s3 runs that file with its own S3 mock. - name: Install Terraform (pinned version, checksum asserted) run: echo "TERRAFORM=$(tests/terraform/install-terraform.sh "$RUNNER_TEMP/terraform")" >> "$GITHUB_ENV" @@ -416,27 +455,17 @@ jobs: EXTENDDB_TEST_ENDPOINT: https://127.0.0.1:18443 EXTENDDB_ADMIN_USER: admin EXTENDDB_ADMIN_PASSWORD: ${{ steps.init.outputs.admin_password }} - # The backup store wire tests' S3 cells; the file sets the AWS_* - # variables for the servers it starts, so none leaks here. - EXTENDDB_TEST_S3_ENDPOINT: http://127.0.0.1:9200 # A file-backed SQLite server without [backup.store] writes to the # defaulted root beside the database file. EXTENDDB_TEST_BACKUP_STORE: filesystem run: devtools/run-tests --extenddb --pytest --comprehensive --terraform --parallel --filter "not import_export" - - name: Run the backup store and job suites - run: python3 -m pytest tests/test_backup_store_config.py tests/test_backup_job.py -v -rP -p no:cacheprovider - # Same rationale as the postgres job: the daemonized server logs to # syslog, so this dump is the only server-side evidence on failure. - name: Dump server syslog on failure if: failure() run: sudo journalctl -t extenddb --no-pager -n 500 || true - - name: Print the S3 mock's log - if: failure() - run: cat moto.log || true - # The integration job checks these lists. - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: always() @@ -454,10 +483,11 @@ jobs: # confirms the server's store is the S3 one; the store configuration # suite's S3 cells need the same endpoint. The job suite # (tests/test_backup_job.py) starts servers of its own: most of its cells - # on the SQLite build's defaulted filesystem root, as on the SQLite job, - # and the store-outage cell on an S3 store at the moto endpoint, which it - # cuts mid-download and restores, so this job runs one restore from an S3 - # store. + # on the SQLite build's defaulted filesystem root, and the store-outage + # cell on an S3 store at the moto endpoint, which it cuts mid-download and + # restores, so this job runs one restore from an S3 store. The SQLite + # shards run neither file, so this job is where the SQLite build runs + # them. The PostgreSQL build runs them in run-integration-backup. run-integration-sqlite-s3: runs-on: extenddb_ubuntu-2404_4-core timeout-minutes: 40 @@ -972,6 +1002,7 @@ jobs: needs: [ run-integration, + run-integration-backup, run-integration-sqlite, run-integration-sqlite-s3, run-integration-dev-mode, @@ -984,6 +1015,7 @@ jobs: steps: - run: | if [ "${{ needs.run-integration.result }}" != "success" ] || \ + [ "${{ needs.run-integration-backup.result }}" != "success" ] || \ [ "${{ needs.run-integration-sqlite.result }}" != "success" ] || \ [ "${{ needs.run-integration-sqlite-s3.result }}" != "success" ] || \ [ "${{ needs.run-integration-dev-mode.result }}" != "success" ] || \ diff --git a/devtools/run-tests b/devtools/run-tests index ed44b9fe8..e74bf2e24 100755 --- a/devtools/run-tests +++ b/devtools/run-tests @@ -38,7 +38,8 @@ # --filter PATTERN pass to cargo test / pytest -k # --parallel[=N] run pytest in parallel (default: 1/3 of CPU cores) # --shard K/N run only shard K of N of each pytest suite (CI); only -# shard 1 runs --terraform +# shard 1 runs --terraform, and no shard runs the SQLite +# build's backup store wire tests # --config PATH config file path (default: extenddb.toml in repo root) # # Environment (--pytest against extenddb): @@ -114,7 +115,8 @@ Options: --filter PATTERN filter for cargo test / pytest -k --parallel[=N] run pytest in parallel (default: 1/3 of CPU cores) --shard K/N run only shard K of N of each pytest suite; only shard 1 - runs --terraform + runs --terraform, and no shard runs the SQLite build's + backup store wire tests --config PATH config file path Environment (--extenddb with an integration suite): @@ -567,7 +569,8 @@ if $RUN_PYTEST; then echo " AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}" # CLI lifecycle tests manage their own server; exclude from main suite. # tests/test_backup_store_config.py does too: it runs below, in the CLI - # lifecycle list on PostgreSQL and in its own step on a SQLite build. + # lifecycle list on PostgreSQL and, in a run without --shard, in its own + # step on a SQLite build. # tests/test_backup_job.py starts its own servers as well; CI runs it in # the integration workflows' backup steps, this script does not run it. # -rP: the summary repeats the passed tests that printed something (the @@ -707,7 +710,10 @@ fi # EXTENDDB_TEST_S3_ENDPOINT names a moto endpoint), `backup list` and # `backup purge` with their signals and exit codes. Its PostgreSQL cells run # in the CLI lifecycle list above. The build decides: the step runs when the -# binary reports itself a SQLite build. +# binary reports itself a SQLite build. A run with --shard skips it: the file +# is not split into shards, so every shard would run all of it, and CI's +# run-integration-sqlite-s3 job runs it once per run on the same build, with +# the S3 mock. if $RUN_PYTEST && [[ "$TARGET" != "real-dynamodb" ]]; then WIRE_BINARY="${EXTENDDB_BINARY:-target/release/$TARGET}" if [[ ! -x "$WIRE_BINARY" ]]; then @@ -716,17 +722,21 @@ if $RUN_PYTEST && [[ "$TARGET" != "real-dynamodb" ]]; then if [[ -x "$WIRE_BINARY" ]] && "$WIRE_BINARY" version 2>/dev/null | grep -q '(sqlite)'; then WIRE_OUTFILE="discussions/test-backup-store-wire-${HASH}.txt" echo "=== Backup store wire tests (SQLite build) → ${WIRE_OUTFILE} ===" - echo " binary: $WIRE_BINARY" - echo " S3 endpoint: ${EXTENDDB_TEST_S3_ENDPOINT:-none (the S3 cells skip)}" - WIRE_ARGS=(python3 -m pytest tests/test_backup_store_config.py -v) - if [[ -n "$FILTER" ]]; then - WIRE_ARGS+=(-k "$FILTER") - fi - if EXTENDDB_BINARY="$WIRE_BINARY" "${WIRE_ARGS[@]}" 2>&1 | tee "$WIRE_OUTFILE"; then - echo " ✓ Backup store wire tests passed" + if [[ -n "$SHARD" ]]; then + echo " skipped: shard $SHARD (run-integration-sqlite-s3 runs this file)" else - echo " ✗ Backup store wire tests failed" - PASS=false + echo " binary: $WIRE_BINARY" + echo " S3 endpoint: ${EXTENDDB_TEST_S3_ENDPOINT:-none (the S3 cells skip)}" + WIRE_ARGS=(python3 -m pytest tests/test_backup_store_config.py -v) + if [[ -n "$FILTER" ]]; then + WIRE_ARGS+=(-k "$FILTER") + fi + if EXTENDDB_BINARY="$WIRE_BINARY" "${WIRE_ARGS[@]}" 2>&1 | tee "$WIRE_OUTFILE"; then + echo " ✓ Backup store wire tests passed" + else + echo " ✗ Backup store wire tests failed" + PASS=false + fi fi echo "" fi From 7e7918cb29874425329e88aca2db79946b3b66b9 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Wed, 25 Nov 2026 05:48:58 +0000 Subject: [PATCH 4/7] ci: run every storage-mongodb test target against the replica set The storage-level section of run-mongodb-tests listed seven test files. Main added tests/secret_rows.rs after this branch's base, and after the merge nothing ran it against a server. mongodb-rust no longer runs the workspace `cargo test`, and the Test workflow has no MongoDB server, so the file's three tests skip there. The section now runs `cargo test -p extenddb-storage-mongodb --tests` with EXTENDDB_TEST_MONGODB_URI and EXTENDDB_TEST_MONGODB_REQUIRED=1, so a new file under tests/ runs without an edit. It skips the snapshot_engine unit tests, which mongodb-snapshot runs. With REQUIRED set, a_standalone_server_is_unsupported fails when EXTENDDB_TEST_MONGODB_STANDALONE_URI is unset, and cargo then stops before the files under tests/. The --rust-live section ran tests/iam_leftovers.rs one test at a time, and the storage-level section now runs it too. Neither the commit that added the serial run nor #923 gives a reason for it. Each test makes databases of its own, and main's mongodb-rust job ran both tests in parallel in its workspace `cargo test` (run 45436870031). This commit removes that section, and the file's comment now says which arguments set REQUIRED. --- .github/workflows/integration-mongodb.yml | 8 ++--- crates/storage-mongodb/tests/iam_leftovers.rs | 2 +- devtools/run-mongodb-tests | 34 ++++++------------- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/.github/workflows/integration-mongodb.yml b/.github/workflows/integration-mongodb.yml index 25d66d6ca..1a36d4fc2 100644 --- a/.github/workflows/integration-mongodb.yml +++ b/.github/workflows/integration-mongodb.yml @@ -192,10 +192,10 @@ jobs: EXTENDDB_TEST_BACKUP_STORE: filesystem # No --rust: it runs the whole workspace's `cargo test`, which the Test # workflow runs on two toolchains. For --rust-integration, - # run-mongodb-tests still runs the storage-mongodb tests that need this - # replica set (records_live and the migration tests), and --rust-live - # runs the crate's other live tests. mongodb-snapshot runs the - # snapshot_engine tests. + # run-mongodb-tests still runs the storage-mongodb tests against this + # replica set (records_live and every test target of the crate), and + # --rust-live runs the crate's other live tests. mongodb-snapshot runs + # the snapshot_engine tests. run: devtools/run-mongodb-tests --rust-live -- --rust-integration # The store-backed CreateBackup on MongoDB: a server with a filesystem diff --git a/crates/storage-mongodb/tests/iam_leftovers.rs b/crates/storage-mongodb/tests/iam_leftovers.rs index fe2f6f801..dfefd754a 100644 --- a/crates/storage-mongodb/tests/iam_leftovers.rs +++ b/crates/storage-mongodb/tests/iam_leftovers.rs @@ -8,7 +8,7 @@ //! with no ExtendDB server in between, as the Cassandra crate's //! `tests/direct_integration.rs` does against a live node. Without the URI //! they skip, unless `EXTENDDB_TEST_MONGODB_REQUIRED` is `1`, which -//! `devtools/run-mongodb-tests --rust-live` sets. +//! `devtools/run-mongodb-tests` sets for `--rust` and `--rust-integration`. //! //! Each test works in a deployment of its own, created with every migration //! as `init` creates it, and drops it at the end. diff --git a/devtools/run-mongodb-tests b/devtools/run-mongodb-tests index 932fc0b0d..eb0030597 100755 --- a/devtools/run-mongodb-tests +++ b/devtools/run-mongodb-tests @@ -346,7 +346,7 @@ echo "" # These two sections run when the arguments name --rust or --rust-integration. # They do not run for --all, which run-tests expands to both suites. CI's # mongodb-rust job passes --rust-integration, so these sections are where it -# runs records_live and the migration tests. +# runs records_live and the crate's test targets. if [[ " ${RUN_TESTS_ARGS[*]} " == *" --rust "* \ || " ${RUN_TESTS_ARGS[*]} " == *" --rust-integration "* ]]; then # The storage-level MongoDB tests that need a live server (the stream @@ -358,16 +358,18 @@ if [[ " ${RUN_TESTS_ARGS[*]} " == *" --rust "* \ EXTENDDB_TEST_MONGODB_URI="mongodb://localhost:$MONGO_PORT/?replicaSet=rs0&directConnection=true" \ cargo test -p extenddb-storage-mongodb --lib -- --ignored records_live echo "" - # The catalog migration tests and the metrics store test: each runs in - # databases of its own on this server, and EXTENDDB_TEST_MONGODB_REQUIRED - # turns a skip for a missing server into a failure. - echo "=== Running MongoDB catalog migration tests (migrations_*, metrics_store) ===" + # Every test target of the crate, its unit tests and each file under + # tests/, so a new test file runs here without an edit. The tests that + # need a server run in databases of their own on this one, and + # EXTENDDB_TEST_MONGODB_REQUIRED turns a skip for a missing server into a + # failure. The skip leaves out the snapshot_engine unit tests: + # mongodb-snapshot runs them, and one of them needs a standalone server + # (EXTENDDB_TEST_MONGODB_STANDALONE_URI), which this runner does not start. + echo "=== Running MongoDB storage-level tests (every test target of the crate) ===" echo "" EXTENDDB_TEST_MONGODB_URI="mongodb://localhost:$MONGO_PORT/?replicaSet=rs0&directConnection=true" \ EXTENDDB_TEST_MONGODB_REQUIRED=1 \ - cargo test -p extenddb-storage-mongodb --test migrations_fresh --test migrations_guards \ - --test migrations_holders --test migrations_locks --test migrations_released \ - --test migrations_spill --test metrics_store + cargo test -p extenddb-storage-mongodb --tests -- --skip snapshot_engine:: echo "" fi echo "=== Running test suite via devtools/run-tests --backend mongodb ===" @@ -450,22 +452,6 @@ if $RUST_LIVE; then RC=1 fi - # A deleted principal or account leaves nothing behind (#693, #694): the - # shared `iam_leftovers_conformance` check, and a deleted account's user - # and role granting nothing. Direct integration tests in tests/, which - # skip without a URI; REQUIRED makes that a failure here. - echo "" - echo "=== MongoDB IAM delete direct integration tests (storage-mongodb) ===" - if EXTENDDB_TEST_MONGODB_REQUIRED=1 \ - cargo test -p extenddb-storage-mongodb --test iam_leftovers -- \ - --test-threads=1; then - echo " ✓ MongoDB IAM delete direct integration tests passed" - else - echo " ✗ MongoDB IAM delete direct integration tests failed" - RC=1 - fi - - # The restore fence cells need the `test-hooks` feature (the GSI backfill # gate `bulk_load` honours is compiled only under it), and no other job # builds that feature, so the takeover fence has no CI coverage without From c8b865862c9de2378dfaa95c869f0ebb829beac6 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Wed, 25 Nov 2026 05:50:31 +0000 Subject: [PATCH 5/7] ci: bound run-integration-backup at 25 minutes, with main's timings The three timing comments gave this branch's run of 9 Nov. Since then tests/test_backup_job.py grew from 1543 to 4712 lines on main. Main ran the Integration workflow for 25 pushes from 18 to 25 Nov. In those runs the backup store and job suites step took 7.3 to 9.1 minutes on the PostgreSQL shards. On the SQLite shards it took 5.9 to 7.5 minutes. With the 61 s of steps before it, the longest of those runs leaves run-integration-backup about 5 minutes under a 15-minute bound. run-integration-backup now stops at 25 minutes. The comments of the two shard jobs and of run-integration-backup give main's step and job times with their date range. --- .github/workflows/integration.yml | 37 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3c05c179d..6be08089a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -87,12 +87,12 @@ jobs: # rather than "latest" because ubuntu-latest migrates to 26.04 in Oct–Nov # 2026 and this compiles Rust; move to 26 deliberately. runs-on: extenddb_ubuntu-2404_4-core - # On #911's CI (run 42637473269) the three shards took 16 min 52 s to - # 18 min 14 s. Of that, 3 min 14 s to 3 min 32 s went to the backup store - # and job suites and their S3 mock, which run-integration-backup now runs - # once per run, so a shard should take 13 min 38 s to 14 min 44 s. 70 is - # the bound of the unsharded job (39 min 49 s on #740's CI, 48 min 4 s - # with the PartiQL wire tests on #411's) and leaves room for a slow runner. + # On main's 25 Integration push runs of 18 to 25 Nov 2026, the 74 + # successful shard jobs took 20.0 to 27.9 minutes. 7.3 to 9.1 minutes of + # each went to the backup store and job suites, which + # run-integration-backup now runs once per run. 70 is the bound of the + # unsharded job (39 min 49 s on #740's CI, 48 min 4 s with the PartiQL + # wire tests on #411's) and leaves room for a slow runner. timeout-minutes: 70 needs: build-postgres # Three shards by test file (devtools/test-shards); the integration job @@ -276,11 +276,11 @@ jobs: # files on the SQLite build. run-integration-backup: runs-on: extenddb_ubuntu-2404_4-core - # On each shard of #911's CI (run 42637473269) the suites took 2 min 52 s - # to 3 min 8 s and the S3 mock 22 to 28 s. With about 30 s of job setup, - # the PostgreSQL container's start, checkout, download and pip install, - # the job should take about 4 min. 15 leaves room for a slow runner. - timeout-minutes: 15 + # On main's 25 Integration push runs of 18 to 25 Nov 2026, the suites + # took 7.3 to 9.1 minutes on each PostgreSQL shard. The steps before them + # took 61 s in this job on run 42691010109. 25 leaves room for a slow + # runner. + timeout-minutes: 25 needs: build-postgres services: postgres: @@ -345,14 +345,13 @@ jobs: run-integration-sqlite: runs-on: extenddb_ubuntu-2404_4-core - # On #911's CI (run 42637473269) the three shards took 20 min 6 s to - # 21 min 52 s. Of that, 4 min 28 s to 4 min 30 s went to the backup store - # and job suites run by name, 2 min 45 s to 2 min 46 s to run-tests' run - # of the store configuration suite, and 25 to 28 s to the S3 mock it - # used. The shards now run neither file (run-integration-sqlite-s3 runs - # both), so a shard should take 12 min 26 s to 14 min 7 s. 60 is the - # bound of the unsharded job (40 min 31 s on #740's CI, 43 min 27 s with - # the PartiQL wire tests on #411's) and leaves room for a slow runner. + # On main's 25 Integration push runs of 18 to 25 Nov 2026, the 75 shard + # jobs took 20.6 to 29.3 minutes. 5.9 to 7.5 minutes of each went to the + # backup store and job suites run by name, and run-tests ran the store + # configuration suite once more. The shards now run neither file + # (run-integration-sqlite-s3 runs both). 60 is the bound of the unsharded + # job (40 min 31 s on #740's CI, 43 min 27 s with the PartiQL wire tests + # on #411's) and leaves room for a slow runner. timeout-minutes: 60 needs: build-sqlite strategy: From 4f7d84380305db2756e525341ca6f4e5249625b6 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Wed, 25 Nov 2026 05:52:54 +0000 Subject: [PATCH 6/7] ci: leave the store configuration suite out of the sharded CLI list Under --shard, the CLI lifecycle list of run-tests still named tests/test_backup_store_config.py, so one PostgreSQL shard ran the file's PostgreSQL cells without the S3 mock. run-integration-backup runs the whole file with the mock, so those cells ran twice in each CI run. The list now takes the file only in a run without --shard, as the SQLite block already does. A local run without --shard keeps it. The --shard help, the comments beside the list and the comment of run-integration-backup say so. --- .github/workflows/integration.yml | 7 +++---- devtools/run-tests | 32 ++++++++++++++++++------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 6be08089a..ebe8cdd68 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -270,10 +270,9 @@ jobs: # per run. Both start servers of their own (the store configuration suite # on a catalog database it creates per test, the job suite on deployments # of its own), so they need the binary, the PostgreSQL service and moto, - # not the shards' server. run-tests' main suite excludes them. Its CLI - # lifecycle list still runs the store configuration suite's PostgreSQL - # cells on one shard, without moto. run-integration-sqlite-s3 runs the two - # files on the SQLite build. + # not the shards' server. run-tests' main suite excludes them, and under + # --shard so does its CLI lifecycle list. run-integration-sqlite-s3 runs + # the two files on the SQLite build. run-integration-backup: runs-on: extenddb_ubuntu-2404_4-core # On main's 25 Integration push runs of 18 to 25 Nov 2026, the suites diff --git a/devtools/run-tests b/devtools/run-tests index 2776ccdf5..92b0b10a4 100755 --- a/devtools/run-tests +++ b/devtools/run-tests @@ -38,8 +38,8 @@ # --filter PATTERN pass to cargo test / pytest -k # --parallel[=N] run pytest in parallel (default: 1/3 of CPU cores) # --shard K/N run only shard K of N of each pytest suite (CI); only -# shard 1 runs --terraform, and no shard runs the SQLite -# build's backup store wire tests +# shard 1 runs --terraform, and no shard runs +# tests/test_backup_store_config.py # --config PATH config file path (default: extenddb.toml in repo root) # # Environment (--pytest against extenddb): @@ -115,8 +115,8 @@ Options: --filter PATTERN filter for cargo test / pytest -k --parallel[=N] run pytest in parallel (default: 1/3 of CPU cores) --shard K/N run only shard K of N of each pytest suite; only shard 1 - runs --terraform, and no shard runs the SQLite build's - backup store wire tests + runs --terraform, and no shard runs + tests/test_backup_store_config.py --config PATH config file path Environment (--extenddb with an integration suite): @@ -573,9 +573,9 @@ if $RUN_PYTEST; then fi echo " AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}" # CLI lifecycle tests manage their own server; exclude from main suite. - # tests/test_backup_store_config.py does too: it runs below, in the CLI - # lifecycle list on PostgreSQL and, in a run without --shard, in its own - # step on a SQLite build. + # tests/test_backup_store_config.py does too: in a run without --shard it + # runs below, in the CLI lifecycle list on PostgreSQL and in its own step + # on a SQLite build. # tests/test_backup_job.py starts its own servers as well; CI runs it in # the integration workflows' backup steps, this script does not run it. # -rP: the summary repeats the passed tests that printed something (the @@ -695,7 +695,13 @@ if $RUN_PYTEST \ && -n "${EXTENDDB_TEST_PG_CONNECTION_STRING:-}" ]]; then CLI_OUTFILE="discussions/test-cli-${HASH}.txt" echo "=== CLI lifecycle tests → ${CLI_OUTFILE} ===" - CLI_ARGS=(python3 -m pytest tests/test_cli_lifecycle.py tests/test_cli_encryption_key.py tests/test_cli_container_readiness.py tests/test_cli_migrate_concurrency.py tests/test_cli_vector_catalog_migration.py tests/test_backup_store_config.py -v) + CLI_ARGS=(python3 -m pytest tests/test_cli_lifecycle.py tests/test_cli_encryption_key.py tests/test_cli_container_readiness.py tests/test_cli_migrate_concurrency.py tests/test_cli_vector_catalog_migration.py -v) + # The list takes the store configuration suite for its PostgreSQL cells, + # except under --shard: CI's run-integration-backup job runs the whole + # file once per run, with the S3 mock. + if [[ -z "$SHARD" ]]; then + CLI_ARGS+=(tests/test_backup_store_config.py) + fi if [[ -n "$FILTER" ]]; then CLI_ARGS+=(-k "$FILTER") fi @@ -714,11 +720,11 @@ fi # S3 store's health against moto (skipped with a reason unless # EXTENDDB_TEST_S3_ENDPOINT names a moto endpoint), `backup list` and # `backup purge` with their signals and exit codes. Its PostgreSQL cells run -# in the CLI lifecycle list above. The build decides: the step runs when the -# binary reports itself a SQLite build. A run with --shard skips it: the file -# is not split into shards, so every shard would run all of it, and CI's -# run-integration-sqlite-s3 job runs it once per run on the same build, with -# the S3 mock. +# in the CLI lifecycle list above, in a run without --shard. The build +# decides: the step runs when the binary reports itself a SQLite build. A +# run with --shard skips it: the file is not split into shards, so every +# shard would run all of it, and CI's run-integration-sqlite-s3 job runs it +# once per run on the same build, with the S3 mock. if $RUN_PYTEST && [[ "$TARGET" != "real-dynamodb" ]]; then WIRE_BINARY="${EXTENDDB_BINARY:-target/release/$TARGET}" if [[ ! -x "$WIRE_BINARY" ]]; then From acdab4ee9edddd1683d3a582028f0647be05dc30 Mon Sep 17 00:00:00 2001 From: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com> Date: Wed, 25 Nov 2026 05:53:19 +0000 Subject: [PATCH 7/7] ci: give CI's mongodb-rust arguments as the run-mongodb-tests example The usage example still passed --rust, which runs the workspace `cargo test` that mongodb-rust no longer runs. It now shows the job's line, `--rust-live -- --rust-integration`. This also corrects two sentences of the message of d9528e6bd for the tree after the merge of main. The Test workflow's second toolchain is now 1.91.1, not 1.88. tests/secret_rows.rs, which main added after this branch's base, also reads EXTENDDB_TEST_MONGODB_URI, and 7e7918cb2 runs it. --- devtools/run-mongodb-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/run-mongodb-tests b/devtools/run-mongodb-tests index eb0030597..ff13c01c6 100755 --- a/devtools/run-mongodb-tests +++ b/devtools/run-mongodb-tests @@ -50,7 +50,7 @@ # devtools/run-mongodb-tests # devtools/run-mongodb-tests -- --pytest --filter test_put_item # devtools/run-mongodb-tests --keep -- --pytest --filter test_rfc0003 -# devtools/run-mongodb-tests --rust-live -- --rust --rust-integration +# devtools/run-mongodb-tests --rust-live -- --rust-integration # devtools/run-mongodb-tests --backup-store none -- --pytest --filter test_mongodb_backup_restore # # Prerequisites: