Skip to content
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

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

ikabiljo
Copy link
Contributor

@ikabiljo ikabiljo commented Jul 20, 2022

Description

- Allowing setting (per-node) validator configuration,
  so that we don't need to restart the node to do so
- disallowing starting already running nodes (which restarts them silently)

Test Plan

- all smoke tests. added test for not starting a node twice

This change is Reviewable

Comment on lines -387 to -396
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();
Copy link
Contributor Author

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.

@ikabiljo ikabiljo force-pushed the ikabiljo/configure_local_swarm branch from 1597f6b to d487692 Compare July 20, 2022 06:36
- 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
@ikabiljo ikabiljo force-pushed the ikabiljo/configure_local_swarm branch from d487692 to 61fa142 Compare July 20, 2022 18:45
@ikabiljo ikabiljo changed the base branch from ikabiljo/failpoint_testing to main July 20, 2022 18:45
@ikabiljo ikabiljo removed the request for review from rajkaramchedu July 20, 2022 18:46
Copy link
Contributor

@bchocho bchocho left a 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.");
Copy link
Contributor

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.

Copy link
Contributor Author

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(
Copy link
Contributor

Choose a reason for hiding this comment

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

Who will call reconfig?

Copy link
Contributor Author

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

@ikabiljo ikabiljo enabled auto-merge (squash) July 21, 2022 18:57
@github-actions
Copy link
Contributor

✅ Forge test success

Forge is land-blocking

all up : 5600 TPS, 3046 ms latency, 4550 ms p99 latency,no expired txns

@ikabiljo ikabiljo merged commit 2fe2a5f into main Jul 21, 2022
@ikabiljo ikabiljo deleted the ikabiljo/configure_local_swarm branch July 21, 2022 19:28
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