-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[smoke-tests] Minimizing node restarts in local swarm smoke tests #2098
Conversation
let mut swarm = new_local_swarm_with_aptos(1).await; | ||
swarm.launch().await.unwrap(); | ||
|
||
// Enable state sync v2 and reboot the node | ||
let validator = swarm.validators_mut().next().unwrap(); | ||
let mut config = validator.config().clone(); | ||
config.state_sync.state_sync_driver.enable_state_sync_v2 = true; | ||
config.save(validator.config_path()).unwrap(); | ||
validator.stop(); | ||
swarm.launch().await.unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example, these lines were starting a node 3 times. (in new_local_swarm_with_aptos, swarm.launch() and swarm.launch after reconfig)
now they are starting it only once.
1597f6b
to
d487692
Compare
- Allowing setting (per-node) validator configuration, so that we don't need to restart the node to do so - dissallowing starting already running nodes (which restarts them silently) Test plan: - all smoke tests. added test for not starting a node twice
d487692
to
61fa142
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
// Start all the validators | ||
for validator in self.validators.values_mut() { | ||
validator.start()?; | ||
} | ||
|
||
self.wait_all_alive(Duration::from_secs(60)).await?; | ||
println!("Swarm launched successfully."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but should we have names for swarms and include them in println's to improve debugging? My understanding is we can have many swarms running in parallel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that is true - @zekun000 ?
@@ -51,6 +51,21 @@ pub async fn transfer_coins( | |||
txn | |||
} | |||
|
|||
pub async fn reconfig( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who will call reconfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some new tests :)
it basically allows you to trigger an epoch change
✅ Forge test successForge is land-blocking
|
Description
Test Plan
This change is