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

Attempt to fix port clash by using different starting port for each test #545

Merged
merged 2 commits into from
Feb 26, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
fixup after rebase
  • Loading branch information
patrickkuo committed Feb 26, 2022
commit 2b09e86929d2d5c08c5afd1a8627929ecb31edd3
30 changes: 9 additions & 21 deletions sui/src/unit_tests/cli_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,7 @@ async fn start_network(
#[tokio::test]
async fn test_move_call_args_linter_command() -> Result<(), anyhow::Error> {
let working_dir = tempfile::tempdir()?;
let mut config = NetworkConfig::read_or_create(&working_dir.path().join("network.conf"))?;

SuiCommand::Genesis { config: None }
.execute(&mut config)
.await?;

// Start network
let network = task::spawn(async move { SuiCommand::Start.execute(&mut config).await });
let network = start_network(working_dir.path(), 10500, None).await?;

// Wait for authorities to come alive.
retry_assert!(
Expand Down Expand Up @@ -564,13 +557,11 @@ async fn test_move_call_args_linter_command() -> Result<(), anyhow::Error> {
.await?;
resp.print(true);

let mut count = 0;
while count < 5 && !logs_contain("Mutated Objects:") {
tokio::time::sleep(Duration::from_millis(100)).await;
count += 1;
}
retry_assert!(
logs_contain("Mutated Objects:"),
Duration::from_millis(1000)
);
assert!(logs_contain("Created Objects:"));
assert!(count < 5);

// Get the created object
let created_obj: ObjectID;
Expand Down Expand Up @@ -658,14 +649,11 @@ async fn test_move_call_args_linter_command() -> Result<(), anyhow::Error> {
.execute(&mut context)
.await?;

tokio::time::sleep(Duration::from_millis(500)).await;
let mut count = 0;
while count < 5 && !logs_contain("Mutated Objects:") {
tokio::time::sleep(Duration::from_millis(100)).await;
count += 1;
}
retry_assert!(
logs_contain("Mutated Objects:"),
Duration::from_millis(1000)
);
assert!(logs_contain("Created Objects:"));
assert!(count < 5);

network.abort();
Ok(())
Expand Down