Skip to content

Commit 6d96cda

Browse files
committed
feat: make devnet bootstrap errors retryable in e2e test
1 parent 12c09d8 commit 6d96cda

File tree

1 file changed

+11
-6
lines changed
  • mithril-test-lab/mithril-end-to-end/src/devnet

1 file changed

+11
-6
lines changed

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)