Skip to content

Commit dd43599

Browse files
authored
Merge pull request #2179 from input-output-hk/jpraynaud/2176-retryable-devnet-bootstrap-e2e-tests
Feat: retryable `devnet` bootstrap errors in e2e tests
2 parents 12c09d8 + f7681a3 commit dd43599

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-test-lab/mithril-end-to-end/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-end-to-end"
3-
version = "0.4.54"
3+
version = "0.4.55"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
documentation = { workspace = true }

mithril-test-lab/mithril-end-to-end/src/devnet/runner.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,22 @@ impl Devnet {
119119

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

122-
bootstrap_command
122+
let exit_status = bootstrap_command
123123
.spawn()
124124
.with_context(|| format!("{bootstrap_script} failed to start"))?
125125
.wait()
126126
.await
127127
.with_context(|| format!("{bootstrap_script} failed to run"))?;
128-
129-
Ok(Devnet {
130-
artifacts_dir: bootstrap_args.artifacts_target_dir.to_owned(),
131-
number_of_pool_nodes: bootstrap_args.number_of_pool_nodes,
132-
})
128+
match exit_status.code() {
129+
Some(0) => Ok(Devnet {
130+
artifacts_dir: bootstrap_args.artifacts_target_dir.to_owned(),
131+
number_of_pool_nodes: bootstrap_args.number_of_pool_nodes,
132+
}),
133+
Some(code) => Err(anyhow!(RetryableDevnetError(format!(
134+
"Bootstrap devnet exited with status code: {code}"
135+
)))),
136+
None => Err(anyhow!("Bootstrap devnet terminated by signal")),
137+
}
133138
}
134139

135140
/// Factory for test purposes

0 commit comments

Comments
 (0)