Skip to content

Commit

Permalink
Merge pull request #2179 from input-output-hk/jpraynaud/2176-retryabl…
Browse files Browse the repository at this point in the history
…e-devnet-bootstrap-e2e-tests

Feat: retryable `devnet` bootstrap errors in e2e tests
  • Loading branch information
jpraynaud authored Dec 16, 2024
2 parents 12c09d8 + f7681a3 commit dd43599
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-test-lab/mithril-end-to-end/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-end-to-end"
version = "0.4.54"
version = "0.4.55"
authors = { workspace = true }
edition = { workspace = true }
documentation = { workspace = true }
Expand Down
17 changes: 11 additions & 6 deletions mithril-test-lab/mithril-end-to-end/src/devnet/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,22 @@ impl Devnet {

info!("Bootstrapping the Devnet"; "script" => &bootstrap_script_path.display());

bootstrap_command
let exit_status = bootstrap_command
.spawn()
.with_context(|| format!("{bootstrap_script} failed to start"))?
.wait()
.await
.with_context(|| format!("{bootstrap_script} failed to run"))?;

Ok(Devnet {
artifacts_dir: bootstrap_args.artifacts_target_dir.to_owned(),
number_of_pool_nodes: bootstrap_args.number_of_pool_nodes,
})
match exit_status.code() {
Some(0) => Ok(Devnet {
artifacts_dir: bootstrap_args.artifacts_target_dir.to_owned(),
number_of_pool_nodes: bootstrap_args.number_of_pool_nodes,
}),
Some(code) => Err(anyhow!(RetryableDevnetError(format!(
"Bootstrap devnet exited with status code: {code}"
)))),
None => Err(anyhow!("Bootstrap devnet terminated by signal")),
}
}

/// Factory for test purposes
Expand Down

0 comments on commit dd43599

Please sign in to comment.