Skip to content

Commit 2d65dcf

Browse files
committed
Fix a race condition in this test
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 0b48c00 commit 2d65dcf

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
@@ -141,6 +141,18 @@ mod tests {
141141
#[cfg(not(mshv2))]
142142
let features = "gdb";
143143

144+
// build it before running to avoid a race condition below
145+
let mut guest_child = Command::new("cargo")
146+
.arg("build")
147+
.arg("--example")
148+
.arg("guest-debugging")
149+
.arg("--features")
150+
.arg(features)
151+
.stdin(Stdio::piped())
152+
.stdout(Stdio::piped())
153+
.status()
154+
.map_err(|e| new_error!("Failed to build guest process: {}", e))?;
155+
144156
let mut guest_child = Command::new("cargo")
145157
.arg("run")
146158
.arg("--example")

0 commit comments

Comments
 (0)