Skip to content

Add multithreaded test infrastructure with Shuttle#1617

Closed
LucasSte wants to merge 1 commit intoanza-xyz:masterfrom
LucasSte:shuttle-infra
Closed

Add multithreaded test infrastructure with Shuttle#1617
LucasSte wants to merge 1 commit intoanza-xyz:masterfrom
LucasSte:shuttle-infra

Conversation

@LucasSte
Copy link
Copy Markdown

@LucasSte LucasSte commented Jun 5, 2024

Problem

The program cache has multiple synchronization mechanisms without any systemic test infrastructure. Although PR #1471 introduced an adhoc test for program cache, it is insufficient for finding issues in the code.

Summary of Changes

I want to adopt shuttle to run specialized multithreaded test in the CI. In order for it to work, all sync, rand and thread imports must come from shuttle.

@LucasSte LucasSte changed the title Add concurrent test infrastructure with Shuttle Add multithreaded test infrastructure with Shuttle Jun 5, 2024
@alessandrod
Copy link
Copy Markdown

instead of cfging shuttle everywhere, we could have an internal thread module somewhere that imports the OG stuff or shuttle depending on cfg.

@LucasSte
Copy link
Copy Markdown
Author

LucasSte commented Jun 5, 2024

instead of cfging shuttle everywhere, we could have an internal thread module somewhere that imports the OG stuff or shuttle depending on cfg.

Do you mean another create in the monorepo? I need the shuttle imports across multiple crates, so a module in one of the existing ones wouldn't work I guess.

@alessandrod
Copy link
Copy Markdown

instead of cfging shuttle everywhere, we could have an internal thread module somewhere that imports the OG stuff or shuttle depending on cfg.

Do you mean another create in the monorepo? I need the shuttle imports across multiple crates, so a module in one of the existing ones wouldn't work I guess.

Hmm, with some luck there's a crate that is imported by pretty much everything? sdk? :D

@LucasSte
Copy link
Copy Markdown
Author

LucasSte commented Jun 5, 2024

instead of cfging shuttle everywhere, we could have an internal thread module somewhere that imports the OG stuff or shuttle depending on cfg.

Do you mean another create in the monorepo? I need the shuttle imports across multiple crates, so a module in one of the existing ones wouldn't work I guess.

Hmm, with some luck there's a crate that is imported by pretty much everything? sdk? :D

That would surely work, but enforcing people to use the right import would be difficult.

@alessandrod
Copy link
Copy Markdown

instead of cfging shuttle everywhere, we could have an internal thread module somewhere that imports the OG stuff or shuttle depending on cfg.

Do you mean another create in the monorepo? I need the shuttle imports across multiple crates, so a module in one of the existing ones wouldn't work I guess.

Hmm, with some luck there's a crate that is imported by pretty much everything? sdk? :D

That would surely work, but enforcing people to use the right import would be difficult.

wouldn't be more difficult than making them import shuttle?

@LucasSte
Copy link
Copy Markdown
Author

LucasSte commented Jun 5, 2024

instead of cfging shuttle everywhere, we could have an internal thread module somewhere that imports the OG stuff or shuttle depending on cfg.

Do you mean another create in the monorepo? I need the shuttle imports across multiple crates, so a module in one of the existing ones wouldn't work I guess.

Hmm, with some luck there's a crate that is imported by pretty much everything? sdk? :D

That would surely work, but enforcing people to use the right import would be difficult.

wouldn't be more difficult than making them import shuttle?

Fair point. There are drawbacks in both approaches. On one hand, people may forget to add the shuttle import, on the other, they may still import from std::sync, instead of solana_sdk::sync (for example).

@LucasSte
Copy link
Copy Markdown
Author

LucasSte commented Jun 5, 2024

I'm open to changing then. Anyone else wants to weight in? @Lichtso and @pgarg66 ?

@LucasSte
Copy link
Copy Markdown
Author

LucasSte commented Jun 6, 2024

Closing this PR in favor of #1634.

@LucasSte LucasSte closed this Jun 6, 2024
@LucasSte LucasSte deleted the shuttle-infra branch July 23, 2025 18:50
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