Skip to content

Commit 8356e44

Browse files
committed
Fix a race condition in this test
Signed-off-by: James Sturtevant <[email protected]>
1 parent 158c55b commit 8356e44

File tree

1 file changed

+12
-0
lines changed
  • src/hyperlight_host/examples/guest-debugging

1 file changed

+12
-0
lines changed

src/hyperlight_host/examples/guest-debugging/main.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ mod tests {
151151
#[cfg(not(mshv2))]
152152
let features = "gdb";
153153

154+
// build it before running to avoid a race condition below
155+
let mut guest_child = Command::new("cargo")
156+
.arg("build")
157+
.arg("--example")
158+
.arg("guest-debugging")
159+
.arg("--features")
160+
.arg(features)
161+
.stdin(Stdio::piped())
162+
.stdout(Stdio::piped())
163+
.status()
164+
.map_err(|e| new_error!("Failed to build guest process: {}", e))?;
165+
154166
let mut guest_child = Command::new("cargo")
155167
.arg("run")
156168
.arg("--example")

0 commit comments

Comments
 (0)