Skip to content

sui-indexer-alt-framework-store-traits: add shared connection test macros - #26268

Merged
evan-wall-mysten merged 5 commits into
mainfrom
indexer_connection_test_macro
May 4, 2026
Merged

sui-indexer-alt-framework-store-traits: add shared connection test macros#26268
evan-wall-mysten merged 5 commits into
mainfrom
indexer_connection_test_macro

Conversation

@evan-wall-mysten

@evan-wall-mysten evan-wall-mysten commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds shared harness-based tests for the store trait contracts in sui-indexer-alt-framework-store-traits.

The shared macros are split by capability:

  • connection_tests!
  • concurrent_connection_tests!
  • sequential_connection_tests!

They cover common Connection, ConcurrentConnection, and SequentialConnection behavior including watermark initialization, committer watermark progression and stale-write rejection, chain-id acceptance/rejection, reader/pruner stale-write rejection, and sequential transaction rollback.

This also adds a trait-crate in-memory MockStore for exercising the shared tests. The framework test store is now FallibleMockStore; it delegates shared watermark and chain-id behavior to the trait-crate MockStore while retaining framework-specific failure, data, transaction, and pruning controls.

Adopters in this branch:

  • sui-indexer-alt-object-store
  • sui-pg-db
  • sui-kvstore

Implementation-specific tests remain where the behavior is storage-specific, such as object-store watermark format migration and pruner wait/saturation behavior.


Failed macro assertions backtraces contain line with assertion:
/Users/evanwall/workspace/sui2/crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs:59:9

and line where macro is called from crate's test mod:
sui_indexer_alt_object_store::tests::connection_tests::init_watermark_fresh_without_checkpoint::{{closure}} at ./src/lib.rs:480:5

Example:

test tests::connection_tests::init_watermark_fresh_without_checkpoint ... FAILED

failures:

---- tests::connection_tests::init_watermark_fresh_without_checkpoint stdout ----

thread 'tests::connection_tests::init_watermark_fresh_without_checkpoint' (5476533) panicked at /Users/evanwall/workspace/sui2/crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs:59:9:
assertion failed: false
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/std/src/panicking.rs:698:5
   1: core::panicking::panic_fmt
             at /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/panicking.rs:80:14
   2: core::panicking::panic
             at /rustc/ded5c06cf21d2b93bffd5d884aa6e96934ee4234/library/core/src/panicking.rs:150:5
   3: sui_indexer_alt_framework_store_traits::testing::Harness::init_watermark_fresh_without_checkpoint::{{closure}}
             at /Users/evanwall/workspace/sui2/crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs:59:9
   4: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /Users/evanwall/.rustup/toolchains/1.92-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/future/future.rs:133:9
   5: sui_indexer_alt_object_store::tests::connection_tests::init_watermark_fresh_without_checkpoint::{{closure}}
             at ./src/lib.rs:480:5

Test plan

New macro tests pass.


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework: sui-indexer-alt-framework-store-traits: add store/connection test macros

@vercel

vercel Bot commented Apr 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment May 4, 2026 9:55pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview May 4, 2026 9:55pm
sui-kiosk Ignored Ignored Preview May 4, 2026 9:55pm

Request Review

@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 16, 2026 18:38 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from 89c3d10 to 0d76edb Compare April 16, 2026 18:42
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 16, 2026 18:42 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten marked this pull request as draft April 16, 2026 18:57
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from 0d76edb to f4cbb15 Compare April 16, 2026 18:58
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 16, 2026 18:58 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from f4cbb15 to 7dc7dac Compare April 16, 2026 19:57
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 16, 2026 19:57 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten marked this pull request as ready for review April 16, 2026 20:01
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 16, 2026 20:01 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from 7dc7dac to 506994a Compare April 16, 2026 20:33
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 16, 2026 20:33 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from 506994a to 519630e Compare April 16, 2026 20:48
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env April 16, 2026 20:48 — with GitHub Actions Inactive

@amnn amnn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mostly looks good, I think the macro approach you have gone for is better than the custom runner approach -- I've left some suggestions to hopefully reduce the boilerplate a little more.

The only issue that needs to be addressed before landing are the changes around pruner watermark (testing wait_for_ms behaviour, and that driving changes in stores that don't currently use wait_for_ms and have been forced to implement something wrong there to conform.

Let me know if the suggested fix there makes sense, otherwise feel free to re-request review, and I will take another look. Otherwise accepted to unblock.

Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-object-store/src/lib.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated

@wlmyng wlmyng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pretty dope

Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mock_store.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
Comment thread crates/sui-indexer-alt-object-store/src/lib.rs Outdated
Comment thread crates/sui-indexer-alt-object-store/src/lib.rs Outdated
Comment thread crates/sui-indexer-alt-framework-store-traits/src/testing/mod.rs Outdated
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from 519630e to fb49dda Compare May 4, 2026 15:53
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env May 4, 2026 15:53 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from fb49dda to 1a3ec2e Compare May 4, 2026 18:54
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env May 4, 2026 18:54 — with GitHub Actions Inactive
@evan-wall-mysten evan-wall-mysten changed the title sui-indexer-alt-framework-store-traits: add store_tests macro and MockStore sui-indexer-alt-framework-store-traits: add shared connection test macros May 4, 2026
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from 1a3ec2e to 9c7f9af Compare May 4, 2026 20:27
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env May 4, 2026 20:27 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten force-pushed the indexer_connection_test_macro branch from 9c7f9af to d49a213 Compare May 4, 2026 21:52
@evan-wall-mysten
evan-wall-mysten temporarily deployed to sui-typescript-aws-kms-test-env May 4, 2026 21:53 — with GitHub Actions Inactive
@evan-wall-mysten
evan-wall-mysten enabled auto-merge (squash) May 4, 2026 21:59
@evan-wall-mysten
evan-wall-mysten disabled auto-merge May 4, 2026 21:59
@evan-wall-mysten
evan-wall-mysten enabled auto-merge (squash) May 4, 2026 21:59
@evan-wall-mysten
evan-wall-mysten merged commit 3f6d2dd into main May 4, 2026
66 checks passed
@evan-wall-mysten
evan-wall-mysten deleted the indexer_connection_test_macro branch May 4, 2026 22:18
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.

3 participants