Skip to content

Commit b8e2b9b

Browse files
committed
Run test with 8 processors
Tests will now fail with a timeout error after 2 minutes. That should bee more than enough to run any test.
1 parent ea3f61a commit b8e2b9b

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/runner/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ uefi = ["bootloader/uefi", "dep:ovmf-prebuilt"]
1515
bootloader = { path = "../..", default-features = false }
1616
strip-ansi-escapes = "0.1.1"
1717
ovmf-prebuilt = { version = "0.1.0-alpha.1", optional = true }
18+
wait-timeout = "0.2.0"

tests/runner/src/lib.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ where
9595
use std::{
9696
io::Read,
9797
process::{Command, Stdio},
98+
time::Duration,
9899
};
99100

101+
use wait_timeout::ChildExt;
102+
100103
const QEMU_ARGS: &[&str] = &[
101104
"-device",
102105
"isa-debug-exit,iobase=0xf4,iosize=0x04",
@@ -105,6 +108,8 @@ where
105108
"-display",
106109
"none",
107110
"--no-reboot",
111+
"-smp",
112+
"8",
108113
];
109114

110115
const SEPARATOR: &str = "\n____________________________________\n";
@@ -138,10 +143,15 @@ where
138143
)
139144
});
140145

141-
let exit_status = child.wait().unwrap();
146+
let Some(exit_status) = child.wait_timeout(Duration::new(120, 0)).unwrap() else {
147+
child
148+
.kill()
149+
.expect("Qemu could not be killed after timeout");
150+
panic!("Test timed out after 2 minutes");
151+
};
142152
match exit_status.code() {
143-
Some(33) => {} // success
144-
Some(35) => panic!("Test failed"), // success
153+
Some(33) => {} // success
154+
Some(35) => panic!("Test failed"),
145155
other => panic!("Test failed with unexpected exit code `{other:?}`"),
146156
}
147157

0 commit comments

Comments
 (0)