Skip to content

Commit

Permalink
[decoupled-execution] slow down single node in smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zekun Li authored and bors-libra committed Nov 11, 2021
1 parent 9ffefb2 commit bb59dc7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion testsuite/forge/src/backend/local/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl LocalSwarmBuilder {
self
}

pub fn build<R>(self, rng: R) -> Result<LocalSwarm>
pub fn build<R>(mut self, rng: R) -> Result<LocalSwarm>
where
R: ::rand::RngCore + ::rand::CryptoRng,
{
Expand All @@ -132,6 +132,13 @@ impl LocalSwarmBuilder {
SwarmDirectory::Temporary(TempDir::new()?)
};

// Single node orders blocks too fast which would trigger backpressure and stall for 1 sec
// which cause flakiness in tests.
if self.number_of_validators.get() == 1 {
// this delays empty block by (10-1) * 30ms
self.template.consensus.mempool_poll_count = 10;
}

let (root_keys, genesis, genesis_waypoint, validators) = ValidatorBuilder::new(
&dir,
diem_framework_releases::current_module_blobs().to_vec(),
Expand Down

0 comments on commit bb59dc7

Please sign in to comment.