test: Porting over the Cassandra Repo integration suite - #350
Merged
robinnsc merged 2 commits intoSep 19, 2026
Merged
Conversation
robinnsc
requested review from
LeeroyHannigan,
amrith,
c33howard,
jcshepherd,
pdf-amzn and
yesyayen
as code owners
September 15, 2026 06:31
Merged
7 tasks done
jcshepherd
force-pushed
the
feat/storage-cassandra-in-tree
branch
2 times, most recently
from
September 15, 2026 21:05
8151972 to
845f933
Compare
The original extenddb-cassandra-plugin repository carried 139 direct integration tests against the storage traits — real node, no HTTP server in between — of which the in-tree port had picked up only the four tag tests. The other 135 covered CRUD, Query/Scan semantics and pagination, transactions (TransactGet, TransactWrite rollback and idempotency, ledger operations), GSI/LSI physical schema and the async propagation workers, streams, access keys, accounts, users, groups, roles, policies, admin and settings stores, and backup/restore state. None of that had automated coverage in-tree. One test binary (direct_integration), one module per area, sharing tests/common/mod.rs — the in-tree descendant of the plug-in's helpers.rs, which is why the port is mostly mechanical: keyspace-prefix adaptation, the two CreateTableInput fields added since the fork, and the skip-without-Cassandra guard on all 139 tests so the serviceless workspace test job stays green. Four tests the inventory flagged as weak were strengthened rather than copied: the table lifecycle and settings tests printed outcomes instead of asserting them (the settings test also now restores the live control-plane knob it mutates, which used to leak past the test run); the pk-only delete-timestamp test carried dead bindings and now verifies the delete; and the sync-GSI test's TODO was hiding a real semantic difference — the plug-in engine wrote GSIs synchronously by default, in-tree the default is 10ms async propagation via a queue no test worker drains, so its "verify the write path executes without crashing" would never have caught a lost index write. It now pins the index to synchronous propagation (the same knob production routing reads) and asserts the index row is visible through the index-scan path. The suite runs in parallel: every test provisions its own account and keyspace. Wired into the Cassandra CI workflow after the existing serial suites.
robinnsc
force-pushed
the
feat/cassandra-direct-tests
branch
from
September 17, 2026 20:28
528d049 to
fe657a3
Compare
Collaborator
Author
|
Rebuilt on the current base after the branch reconstruction dropped merged PR #339 (see #349 for the full story; restored as 439ca5b, which this suite depends on for the skip-guard helper and CI workflow). Worth highlighting: this suite already paid for itself before merging — the delete_item tests caught the rebuilt base's OCC delete fast path silently skipping partition_max_delete_timestamp, which disarmed the transaction prepare path's new-item-vs-delete ordering check for plain deletes. Fixed on the base as 0aebbe4; 139/139 green on top of it. |
jcshepherd
reviewed
Sep 18, 2026
|
|
||
| #[tokio::test] | ||
| async fn test_create_account() { | ||
| if crate::helpers::skip_without_cassandra() { |
Collaborator
There was a problem hiding this comment.
Just checking: is this function already pushed?
jcshepherd
approved these changes
Sep 18, 2026
jcshepherd
left a comment
Collaborator
There was a problem hiding this comment.
Overall, LGTM. Two questions:
- is helpers::skip_without_cassandra() already checked in?
- Do you plan to migrate storage-cassandra/tests/metadata_integration.rs and ttl_integration.rs to this suite?
Review suggestion from jcshepherd. The standalone metadata_integration binary held one test — the in-tree consolidation of the plug-in repo's four tag tests — while the ported suite carried those four originals, so merging the binaries also deduplicates: the consolidated phased lifecycle test replaces the four in direct/metadata_engine.rs (same assertions, one engine connection instead of four catalog-migration setups). It is parallel-safe like the rest of the suite. The TTL suite stays its own serial binary: its tests drive global sweep, repair, and audit passes that would see every concurrent test's tables, so the two binaries have deliberately opposite concurrency contracts. One fewer test binary to link, one fewer CI step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Porting over the original extenddb-cassandra-plugin repository's direct integration suit. 136 tests that exercise the storage traits directly against a real Cassandra node (139 ported, minus the four plug-in tag tests deduplicated into the consolidated in-tree lifecycle test when the metadata suite was folded in — see the second commit) — no HTTP server in between — of which the in-tree port had previously picked up only the four tag tests.
Coverage the tree gains: CRUD and key-type handling (decimal, binary), Query/Scan semantics, pagination, segments and index reads, transactions (TransactGet, TransactWrite rollback and idempotency, ledger internals, lock protection), GSI/LSI physical schema and the async propagation workers, streams (write, read, pagination, shards), table lifecycle, and the whole management plane: access keys, accounts, users, groups, roles, policies, admin, settings, backup/restore state. None of that had automated coverage in-tree; the TTL suites use some of these operations but never assert their general semantics.
Structure: one test binary (
tests/direct_integration.rs), one module per area undertests/direct/, all sharingtests/common/mod.rs— which is the in-tree descendant of the plug-in'shelpers.rs, so the port is mostly mechanical: keyspace-prefix adaptation, twoCreateTableInputfields added since the fork, and the skip-without-Cassandra guard on every test so the serviceless workspacecargo testjob stays green (same pattern the existing suites use,EXTENDDB_TEST_CASSANDRA=requiredin the dedicated workflow).Why
135 of 139 tests had no in-tree equivalent (~8,600 LOC of coverage). This suite is the safety net under everything else the in-tree port changes.
Not copied verbatim
Four tests the porting inventory flagged as weak were strengthened, and one of them promptly caught something:
control_plane_delay_seconds— a live control-plane knob in the shared catalog — and left the test value behind; it now restores what it found (or the reader default, 0.25, when the key was absent).Parallelism and CI
The suite runs with default parallelism — every test provisions its own account and keyspace. Full run on a local single node: ~17–19 minutes wall, 139/139. Wired into the Cassandra CI workflow as a step after the existing serial suites; this will grow that job's runtime, and if it becomes the long pole the next step is splitting it into its own job in the same workflow.
One observed interaction worth knowing: running the other TTL suite immediately after this one on the same node hit one flaky claim-contention failure while Cassandra was still dropping this suite's 139 keyspaces in the background (test-fixture Drop is async fire-and-forget). It passes reliably in isolation and CI runs the suites in the opposite order, so nothing is changed here — flagging it in case it ever shows up in someone's local run.
Testing done
Real Cassandra 4.1, single node:
cargo test -p extenddb-storage-cassandra --test direct_integration— 139 passed, 0 failed (two full runs, plus targeted reruns of every strengthened test)ttl_integration26/26 serial,metadata_integration1/1, lib 43/43cargo clippy --all-targets -- -D warnings— clean (the ported code carried ten lint findings; fixed)cargo fmt --all -- --check— cleanrequiredin CI)Checklist
cargo fmt --all -- --check)-D warningsclean)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.