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

Remove spin locks from E2E tests #1627

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 5 additions & 34 deletions tests/src/e2e/ledger_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use std::path::PathBuf;
use std::process::Command;
use std::str::FromStr;
use std::sync::Arc;
use std::time::{Duration, Instant};

use borsh::BorshSerialize;
use color_eyre::eyre::Result;
Expand Down Expand Up @@ -1985,16 +1984,8 @@ fn pos_bonds() -> Result<()> {
"Current epoch: {}, earliest epoch for withdrawal: {}",
epoch, delegation_withdrawable_epoch
);
let start = Instant::now();
let loop_timeout = Duration::new(60, 0);
loop {
if Instant::now().duration_since(start) > loop_timeout {
panic!(
"Timed out waiting for epoch: {}",
delegation_withdrawable_epoch
);
}
let epoch = get_epoch(&test, &validator_one_rpc)?;
let epoch = epoch_sleep(&test, &validator_one_rpc, 120)?;
if epoch >= delegation_withdrawable_epoch {
break;
}
Expand Down Expand Up @@ -2181,13 +2172,8 @@ fn pos_rewards() -> Result<()> {
epoch, wait_epoch
);

let start = Instant::now();
let loop_timeout = Duration::new(40, 0);
loop {
if Instant::now().duration_since(start) > loop_timeout {
panic!("Timed out waiting for epoch: {}", wait_epoch);
}
let epoch = get_epoch(&test, &validator_zero_rpc)?;
let epoch = epoch_sleep(&test, &validator_one_rpc, 120)?;
if dbg!(epoch) >= wait_epoch {
break;
}
Expand Down Expand Up @@ -2263,13 +2249,8 @@ fn test_bond_queries() -> Result<()> {
client.assert_success();

// 3. Wait for epoch 4
let start = Instant::now();
let loop_timeout = Duration::new(20, 0);
loop {
if Instant::now().duration_since(start) > loop_timeout {
panic!("Timed out waiting for epoch: {}", 1);
}
let epoch = get_epoch(&test, &validator_one_rpc)?;
let epoch = epoch_sleep(&test, &validator_one_rpc, 120)?;
if epoch >= Epoch(4) {
break;
}
Expand Down Expand Up @@ -2320,13 +2301,8 @@ fn test_bond_queries() -> Result<()> {
client.assert_success();

// 6. Wait for epoch 7
let start = Instant::now();
let loop_timeout = Duration::new(20, 0);
loop {
if Instant::now().duration_since(start) > loop_timeout {
panic!("Timed out waiting for epoch: {}", 7);
}
let epoch = get_epoch(&test, &validator_one_rpc)?;
let epoch = epoch_sleep(&test, &validator_one_rpc, 120)?;
if epoch >= Epoch(7) {
break;
}
Expand Down Expand Up @@ -2560,13 +2536,8 @@ fn pos_init_validator() -> Result<()> {
"Current epoch: {}, earliest epoch with updated bonded stake: {}",
epoch, earliest_update_epoch
);
let start = Instant::now();
let loop_timeout = Duration::new(20, 0);
loop {
if Instant::now().duration_since(start) > loop_timeout {
panic!("Timed out waiting for epoch: {}", earliest_update_epoch);
}
let epoch = get_epoch(&test, &non_validator_rpc)?;
let epoch = epoch_sleep(&test, &non_validator_rpc, 120)?;
if epoch >= earliest_update_epoch {
break;
}
Expand Down
Loading