Skip to content

ci: remove repeated test runs from mongodb-rust and the integration shards - #911

Merged
LeeroyHannigan merged 8 commits into
mainfrom
ci/mongodb-rust-crate-tests
Nov 26, 2026
Merged

LeeroyHannigan merged 8 commits into
mainfrom
ci/mongodb-rust-crate-tests

Conversation

@LeeroyHannigan

@LeeroyHannigan LeeroyHannigan commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Changes since the last review

navareamol reviewed d833c71 on 24 November. The commits since then:

  • 1d4930a75 merges main at a417b2f82. No file conflicted. The merge brings crates/storage-mongodb/tests/secret_rows.rs (feat(auth): wrap the credential encryption key with a KEK kept outside the catalog #1003), the serial iam_leftovers run under --rust-live (fix(iam): delete what a principal or account owns with it #923) and the 15th workspace crate, crates/wasm-adapter (feat(wasm): [Add WebAssembly browser support for ExtendDB #1009).
  • 7e7918cb2 makes the storage-level section of devtools/run-mongodb-tests run every test target of extenddb-storage-mongodb, secret_rows included. It removes the serial iam_leftovers run, which repeated a file that the section now runs.
  • c8b865862 sets timeout-minutes: 25 on run-integration-backup. The timing comments of the three jobs give main's figures from 18 to 25 November.
  • 4f7d84380 removes tests/test_backup_store_config.py from the CLI lifecycle list of devtools/run-tests in a run with --shard.
  • acdab4ee9 gives CI's arguments, --rust-live -- --rust-integration, as the usage example of devtools/run-mongodb-tests. Its message also corrects two sentences of the message of d9528e6bd for the tree after the merge: the second Test toolchain is 1.91.1, and secret_rows.rs also reads EXTENDDB_TEST_MONGODB_URI.

What

Two jobs ran tests that CI also runs elsewhere in the same run.

mongodb-rust

CI's mongodb-rust job no longer runs the whole workspace's cargo test. It ran devtools/run-mongodb-tests --rust-live -- --rust --rust-integration. The --rust suite of devtools/run-tests runs cargo test over all 15 workspace crates. The job now runs devtools/run-mongodb-tests --rust-live -- --rust-integration.

devtools/run-mongodb-tests now names both Rust suites in the condition of its storage-level sections. The old condition matched the substring --rust, which --rust-integration also contains. Without --rust, the old condition selects these sections only because of that match. The new condition names --rust-integration, so the job does not depend on the substring.

The storage-level sections run records_live and every test target of extenddb-storage-mongodb. The second section runs cargo test -p extenddb-storage-mongodb --tests -- --skip snapshot_engine:: with EXTENDDB_TEST_MONGODB_URI and EXTENDDB_TEST_MONGODB_REQUIRED=1, as the PostgreSQL storage job runs --tests. A new file under crates/storage-mongodb/tests/ runs there without an edit. Before, the section named seven files, and secret_rows.rs, which main added after this branch's base, was not among them.

The skip omits the 12 snapshot_engine unit tests, which the mongodb-snapshot job runs. One of them, a_standalone_server_is_unsupported, needs a standalone server, which mongodb-snapshot starts beside its replica set. With EXTENDDB_TEST_MONGODB_REQUIRED set and EXTENDDB_TEST_MONGODB_STANDALONE_URI unset, it fails.

The --rust-live section no longer runs tests/iam_leftovers.rs with --test-threads=1. The storage-level section runs the file with the default thread count.

The integration shards

Every shard of run-integration (PostgreSQL) and run-integration-sqlite ran tests/test_backup_store_config.py and tests/test_backup_job.py by name. Each SQLite shard also ran the store configuration suite inside devtools/run-tests.

  • PostgreSQL: the new run-integration-backup job runs the two files once per run, with the shards' PostgreSQL service, the S3 mock and the same environment. The integration job needs it. In a run with --shard, the CLI lifecycle list of devtools/run-tests omits the store configuration suite. A run without --shard keeps it.
  • 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 already ran both files on the same build with an S3 mock.

run-integration-backup stops at 25 minutes.

Against main, the PR adds 149 lines and removes 106 in five files. None of them is production code.

Why

No issue tracks this change.

The mongodb-integration check waits for six jobs, and mongodb-rust finishes last. On main's push run 45436870031 (24 November, 89fc971), the workspace cargo test section took 10 min 3 s of the job's 28 min 51 s. The Test workflow runs the same test binaries on stable and on 1.91.1.

The integration check waits for the shards. Main ran the Integration workflow for 25 pushes from 18 to 25 November. In those runs the backup store and job suites step took 7.3 to 9.1 minutes on the PostgreSQL shards. The 74 PostgreSQL shard jobs that passed took 20.0 to 27.9 minutes. On the SQLite shards the step took 5.9 to 7.5 minutes, and the 75 shard jobs took 20.6 to 29.3 minutes. tests/test_backup_job.py has 4712 lines on main and had 1543 at this branch's base.

The measurements below are from 9 November, before the merge of main. On main's push run for 96a6b6f (MongoDB run 42630213888), the workspace cargo test took 12.2 of mongodb-rust's 31.8 minutes. Cargo compiled the test binaries in 4 min 58 s and ran them in 7 min 12 s.

On this PR's run for d9528e6 (run 42637473269, 9 November), the PostgreSQL shards took 16 min 52 s to 18 min 14 s. The two files took 2 min 52 s to 3 min 8 s of that, and their S3 mock 22 to 28 s more. The SQLite shards took 20 min 6 s to 21 min 52 s. The two files took 4 min 28 s to 4 min 30 s of that. The run inside devtools/run-tests took 2 min 45 s to 2 min 46 s more. The projection from that run without these files was 13 min 38 s to 14 min 44 s for a PostgreSQL shard. For a SQLite shard it was 12 min 26 s to 14 min 7 s.

Testing done

CI on acdab4e

CI passed on this head, 62 of 62 checks. In MongoDB run 45561928546, mongodb-rust ran the storage-level section, and tests/secret_rows.rs passed 3 tests there. Job times in minutes, from Integration run 45561928654 and that MongoDB run, 25 November:

Job Minutes
mongodb-rust 20.6
build-mongodb 4.7
run-integration shards (PostgreSQL) 15.1 to 17.3
run-integration-sqlite shards 13.3 to 16.0
run-integration-backup 8.2, with 7.4 in the backup store and job suites step

Both runs waited about 48 minutes for their first runner. So their times from the start of each workflow run are not comparable with the 9 November tables below.

mongodb-rust

  • The tests that mongodb-rust ran against MongoDB on main still run against a replica set:
    • records_live and every test target of the crate run in the storage-level sections of run-mongodb-tests. The test targets run with EXTENDDB_TEST_MONGODB_REQUIRED=1.
    • The data_engine and backup_engine live tests and the restore fence cells run under --rust-live.
    • The 12 snapshot_engine tests run in the mongodb-snapshot job, with EXTENDDB_TEST_MONGODB_REQUIRED=1.
  • The storage-level sections of devtools/run-mongodb-tests ran locally at 7e7918c, with the arguments --rust-integration, against a MongoDB 7 replica set on 127.0.0.1. The later commits change neither the sections nor the crate. records_live passed 7 tests. The --tests line passed 178 unit tests and every file under tests/. It skipped the 12 snapshot_engine tests, and the 84 #[ignore]d live tests stayed ignored:
File Passed
iam_leftovers 2
interpreter_selftests 18
metrics_store 2
migrations_fresh 9
migrations_guards 7
migrations_holders 10
migrations_locks 11
migrations_released 13
migrations_spill 1
pushdown_parity 20
secret_rows 3
  • The two sections took 945 s on a shared development host with a load average of 25 on 16 cores. migrations_guards took 818 s of that. On main's run 45436870031 the same file took 2 min 23 s.
  • The same --tests command without the skip failed. a_standalone_server_is_unsupported panicked with EXTENDDB_TEST_MONGODB_REQUIRED is set but EXTENDDB_TEST_MONGODB_STANDALONE_URI is not; the standalone test must run, not skip. cargo then stopped before the files under tests/.
  • fix(iam): delete what a principal or account owns with it #923 added the serial iam_leftovers run when it moved the tests from src/ to tests/. It kept --test-threads=1 from the old --lib -- --ignored line. Neither its commits nor its review give a reason for the serial run. Each test creates databases of its own, named after the process id, a counter and the test. Main's mongodb-rust job ran both tests in parallel in its workspace cargo test (run 45436870031), and so did the local run above.
  • Of the 15 workspace crates, only crates/storage-mongodb reads EXTENDDB_TEST_MONGODB_URI or EXTENDDB_TEST_MONGODB_REQUIRED. The Test workflow runs every test binary of the workspace cargo test. It has no MongoDB server, so the tests that need one skip there.
  • The Test workflow does not set EXTENDDB_ADMIN_USER and EXTENDDB_ADMIN_PASSWORD, which run-mongodb-tests exports. When the environment has them, an in-memory or dev SQLite open in crates/storage-sqlite passes them to bootstrap_dev_rows. On this branch before the merge of main, the workspace tests passed both with and without them.
  • The old and new conditions give the same result for --rust, --rust-integration, --rust --rust-integration, --pytest --comprehensive --parallel and --pytest --parallel --filter backup. They also give the same result for all 255 combinations of the eight suite flags of run-tests.
  • bash -n passes on devtools/run-mongodb-tests. shellcheck reports one info finding there: SC2329, for the cleanup function that trap calls. Main's copy of the script gives the same finding.
  • CI on d9528e6 passed. Minutes on main's push run for 96a6b6f and on this PR's run, both on 9 November:
Measure Main, 96a6b6f This PR, d9528e6
mongodb-rust run time 31.8 17.7
The workspace cargo test in mongodb-rust 12.2 not run
build-mongodb run time 6.5 4.4
mongodb-integration, from the start of the workflow run 38.6 22.4
  • The removed section accounts for 12.2 of the 14.1 minutes that mongodb-rust saved. The Rust cache likely explains the other 1.9 minutes and the 2.1 minutes that build-mongodb saved. Main's run started without one and saved the cache that this PR's run restored.
  • The other sections of mongodb-rust ran the same tests in both runs, and all passed. The storage-level sections ran 6 records_live tests and 41 migration tests. The Rust integration suite ran 514 tests. The live test sections ran 19 data_engine tests, 41 backup engine tests and 3 restore fence cells. This PR's log has no === Rust tests (debug) section.

The integration shards

  • On run 42637473269, run-integration-sqlite-s3 passed every test that a SQLite shard passed in either of its runs of the two files. Shard 2's run by name passed 26 tests, and its run inside devtools/run-tests passed 13 tests of the store configuration suite.
  • The new job has the same services as a PostgreSQL shard and the same steps for the two files. From reading the two files' fixtures, nothing they read comes from an earlier shard step: each PostgreSQL cell runs extenddb init on a catalog of its own.
  • With a stub SQLite binary, the block of devtools/run-tests runs the store configuration suite in a run without --shard. For shards 1/3 and 2/3 it prints a skip line.
  • The CLI lifecycle list, built from the lines of devtools/run-tests at acdab4e, names tests/test_backup_store_config.py in a run without --shard. With --shard 1/3, and with --shard 2/3 --filter backup, it does not. For shards 1/3 to 3/3, devtools/test-shards prepare collected 37 tests in five files from that list. devtools/test-shards check over the three legs passed.
  • actionlint with shellcheck gives the same findings for the two workflows at acdab4e as at d833c71. They are the custom runner label (20) and SC2034 for the unused loop variable i of seven server waits (7). bash -n passes on devtools/run-tests. shellcheck gives the same finding there as on main's copy, SC2034 for prefix_upper.
  • CI on d833c71 passed. Minutes for the jobs of the Integration workflow on this PR's runs of 9 November, for d9528e6 (run 42637473269) and d833c71 (run 42691010109):
Job d9528e6 d833c71
run-integration shards 16.9 to 18.2 12.8 to 14.8
run-integration-sqlite shards 20.1 to 21.9 10.2 to 13.8
run-integration-backup not run 4.4
integration, from the start of the workflow run 26.5 19.8
  • On run 42691010109, run-integration-backup passed 17 tests and skipped 15, as each PostgreSQL shard's run of the two files did on run 42637473269. run-integration-sqlite-s3 gave the same counts as on that run. Its run in devtools/run-tests passed 12 and skipped 5, and its run by name passed 28 and skipped 4. Each SQLite shard printed the skip line.

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy -- -W clippy::pedantic)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, or public CLI surface, an RFC has been accepted or is linked
    below. Otherwise, an ADR captures the decision (link below).

ADR / RFC: n/a

Breaking changes

None.


By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

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 76b9710 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.
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.
On the CI run of d9528e6 (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.
@LeeroyHannigan LeeroyHannigan changed the title ci: run only the MongoDB-backed Rust tests in mongodb-rust ci: remove repeated test runs from mongodb-rust and the integration shards Nov 9, 2026
@navareamol navareamol self-assigned this Nov 24, 2026

@navareamol navareamol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think two things stop running or change after this branch meets main, and the timing numbers are out of date.

  1. crates/storage-mongodb/tests/secret_rows.rs was added to main after your base. On main run 45436870054, mongodb-rust runs it inside the workspace cargo test against the replica set: "3 passed" in 3.79 s. After this change nothing runs it against a server: run-mongodb-tests lists records_live, the migration files, metrics_store and (under --rust-live) iam_leftovers, and grep secret_rows over .github and devtools finds nothing. The Test workflow has no MongoDB server. Could the storage-level section run every test target of the crate (cargo test -p extenddb-storage-mongodb --tests, with EXTENDDB_TEST_MONGODB_REQUIRED=1), the way the PostgreSQL storage job uses --tests? A hand-written list will drop the next new file the same way.

  2. The comments give the new job "about 4 min" with a 15 minute bound, and shard times of 13 to 14 minutes. On 75 PostgreSQL shard runs on main today, the backup suites step took 7.5 to 9.5 minutes (6.0 to 7.5 on SQLite), because tests/test_backup_job.py grew by about 3500 lines since your base. I expect the new job to take about 11 minutes with setup, which leaves 4 minutes under the bound. Could you rebase, rerun CI, and set the bound and the comment numbers from the new run? I think 25 minutes is safer.

  3. devtools/run-tests line 693 still lists tests/test_backup_store_config.py in the CLI lifecycle list, and run-integration-backup runs the whole file again, so the PostgreSQL cells run twice (about 8 s of the first). Is that intended?

  4. devtools/run-mongodb-tests line 53 still shows --rust-live -- --rust --rust-integration as the example, which runs the workspace tests that CI dropped. The description also names 1.88.0 as the second Test toolchain; main now uses 1.91.1.

I will approve once the storage-level section covers secret_rows (or every test target of the crate), and the branch is rebased with CI green and the timing comments and the new job's bound matching the new run.

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.
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.
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.
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 d9528e6 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 7e7918c runs
it.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

Thanks, all four hold.

  1. 7e7918c: the storage-level section now runs cargo test -p extenddb-storage-mongodb --tests with EXTENDDB_TEST_MONGODB_REQUIRED=1, so secret_rows and any new file under tests/ run against the replica set. It adds -- --skip snapshot_engine::. 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/. mongodb-snapshot runs those 12 tests with both servers. The same commit removes the serial iam_leftovers run under --rust-live, since --tests runs that file too. Neither fix(iam): delete what a principal or account owns with it #923 nor its commits give a reason for the serial run. A local run against a replica set passed secret_rows (3 tests) and every other file. On this head's CI, mongodb-rust ran tests/secret_rows.rs against the replica set, and its 3 tests passed (MongoDB run 45561928546).

  2. 1d4930a merges main. A merge keeps the commits you reviewed as they are. c8b8658 sets run-integration-backup's bound to 25 minutes. The three timing comments now give main's 25 Integration push runs of 18 to 25 November. There the backup store and job suites step took 7.3 to 9.1 minutes on the PostgreSQL shards and 5.9 to 7.5 on the SQLite shards. CI is green on this head (62 of 62). In its Integration run 45561928654, run-integration-backup took 8 min 9 s. Its suites step took 7 min 23 s, inside the range the comments give.

  3. Not intended. 4f7d843 adds the file to the CLI lifecycle list only in a run without --shard, as the SQLite block does. CI runs it once, in run-integration-backup, and a local run without --shard keeps it.

  4. acdab4e makes the example CI's line, --rust-live -- --rust-integration. The description now names 1.91.1.

@navareamol navareamol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve. Checked at acdab4e, with main at a417b2f already merged into the branch.

  • The storage-level section now runs cargo test -p extenddb-storage-mongodb --tests -- --skip snapshot_engine:: with the replica set and EXTENDDB_TEST_MONGODB_REQUIRED=1. Against a local replica set the lib tests (178) and all 11 test files ran, secret_rows included (3 passed). In CI the mongodb-rust job shows the same counts and takes 20.6 minutes, against 29 to 32 on main. Listing the command with --list shows every file under tests/, and a file I dropped in was picked up. Naming only one --test makes the check report ten files missing.
  • run-integration-backup has a 25 minute bound. I recomputed main's runs from 18 to 25 Nov: the suites take 7.3 to 9.1 minutes on the PostgreSQL shards, so the bound is about 2.5 times the slowest run. On this head the job took 8.2 minutes.
  • tests/test_backup_store_config.py is no longer in the sharded CLI list. CI's shard check passes.
  • bash -n, shellcheck and actionlint report nothing the PR added. The 62 checks pass.

One optional point: devtools/run-mongodb-tests --rust-live on its own no longer runs iam_leftovers, because the section only runs for --rust and --rust-integration. CI always passes --rust-integration.

@LeeroyHannigan
LeeroyHannigan added this pull request to the merge queue Nov 25, 2026
@robinnsc robinnsc mentioned this pull request Nov 25, 2026
6 of 8 tasks
@LeeroyHannigan
LeeroyHannigan removed this pull request from the merge queue due to the queue being cleared Nov 25, 2026
@LeeroyHannigan
LeeroyHannigan added this pull request to the merge queue Nov 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2026
@LeeroyHannigan
LeeroyHannigan added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 1369bbd Nov 26, 2026
62 checks passed
@LeeroyHannigan
LeeroyHannigan deleted the ci/mongodb-rust-crate-tests branch November 26, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants