Skip to content

Add contributor-only Shuttle lock tests#370

Open
l1x wants to merge 2 commits into
xacrimon:masterfrom
vectorian-rs:feature/shuttle-concurrency-testing
Open

Add contributor-only Shuttle lock tests#370
l1x wants to merge 2 commits into
xacrimon:masterfrom
vectorian-rs:feature/shuttle-concurrency-testing

Conversation

@l1x
Copy link
Copy Markdown

@l1x l1x commented Apr 24, 2026

Summary

This adds contributor-only Shuttle model-checking for DashMap's internal lock without changing the default runtime path.

What changed

  • keep the existing parking_lot_core backend as the default build/runtime behavior
  • add a shuttle-gated parking shim in src/lock.rs for model checking the lock under Shuttle
  • model the Shuttle suite as an explicit [[test]] target with required-features = ["shuttle"]
  • document Shuttle as a contributor-only workflow in the README instead of a normal user-facing feature
  • add a dedicated CI job for cargo test --features shuttle --test shuttle
  • add Shuttle coverage for reader/writer contention and downgrade() wakeup behavior

Tradeoffs

  • shuttle still exists as a Cargo feature because the alternate lock backend needs conditional compilation in library code, but the intended surface is contributor-only rather than a supported end-user mode
  • full cargo test --features shuttle remains intentionally unsupported; only cargo test --features shuttle --test shuttle is documented and exercised in CI
  • Shuttle runs on stable in its own CI job so the pinned default toolchain and default-path checks stay unchanged

Verification

  • cargo fmt --all
  • cargo clippy --all-targets --features all -- -D warnings
  • cargo test
  • RUSTUP_TOOLCHAIN=stable cargo test --features shuttle --test shuttle

l1x added 2 commits April 24, 2026 11:20
Keep the default parking_lot backend and runtime behavior unchanged.

Add a Shuttle-specific parking shim for model-checking the internal lock, expose it through a dedicated feature-gated test target, and cover reader/writer contention plus downgrade wakeups.

Document the supported contributor workflow and add a separate CI job for the stable Shuttle test command.
@l1x l1x mentioned this pull request Apr 26, 2026
@eggyal
Copy link
Copy Markdown

eggyal commented Apr 29, 2026

I wonder if it wouldn't make more sense for this to be a wrapper within the shuttle project?

Oh, I see someone has submitted exactly that: awslabs/shuttle#279

@l1x
Copy link
Copy Markdown
Author

l1x commented Apr 30, 2026

@eggyal should we cancel this PR then?

@sarsko
Copy link
Copy Markdown

sarsko commented May 1, 2026

awslabs/shuttle#279 and this PR does different things.

This PR allows DashMap itself to be tested with Shuttle. awslabs/shuttle#279 is meant for users of DashMap to be able to run their application with Shuttle by just swapping their import in their Cargo.toml.

Regarding this PR:
There is a parking_lot wrapper in Shuttle that you could use:
https://github.com/awslabs/shuttle/tree/main/wrappers/parking_lot
If there is anything needed for DashMap that we currently don't have then please put in a PR and I'll review it.

@l1x
Copy link
Copy Markdown
Author

l1x commented May 3, 2026

@sarsko i was just wondering how could DashMap be tested with shuttle. I use Shuttle for my own code and wanted to expand to DashMap and I found that thread talking about it.

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