-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close chains after tests finish (#2782)
* Remove `--from` requirement for `close-chain` cmd. Change the CLI to always expect the chain ID without the flag name. * Cache the command binary path in `ClientWrapper` Avoid resolving the binary path every time the command needs to be executed, and prepare to have the path available for a synchronous call inside a `Drop` implementation. * Add a `linera wallet show --short` option Print a simple formatted list of chains in the wallet. * Refactor to add a `command_arguments` helper Prepare to be able to get all the common arguments in the synchronous `Drop` implementation. * Create an `OnClientDrop` helper enumeration An option to configure if chains should be closed when the `ClientWrapper` is dropped. * Add a `ClientWrapper::close_chain_on_drop` config. Allow configuring if all chains should be closed when the client finishes. * Close chains when `ClientWrapper` is dropped List all chains in the wallet and close them one by one. * Drop the clients in separate threads It's not possible to know which client will have the round to be able to close the shared chain, so both clients must run in parallel (not in separate asynchronous tasks, because the `Drop` is blocking) so that the one that has the round can actually close it and unblock the other client. * Refactor to create a helper function in the test Avoid duplicating the code and improve readability.
- Loading branch information
Showing
11 changed files
with
272 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.