tests: fast host suites

The timing rules are in two tests (upgrade_and_discovery_deadlines,
stop_deadlines). All other tests use a grace period of 0 or core.stop,
poll with deadlines instead of sleeping, and use the persistent cache in
CARGO_TARGET_TMPDIR. The 128-cycle singleton test is an ignored stress
test that nix flake check runs; the normal run has a 4-cycle sample.
Warm, the activation suite takes 12 s (was 47 s), and cargo test
--workspace takes 65 s.
This commit is contained in:
2026-10-23 08:20:49 +01:00
parent 1386acc924
commit 41818107a2
7 changed files with 134 additions and 73 deletions
+2 -5
View File
@@ -14,7 +14,7 @@ fn fixture() -> PathBuf {
.parent()
.unwrap()
.to_owned();
let target = root.join("target/core/console-guests");
let target = PathBuf::from(concat!(env!("CARGO_TARGET_TMPDIR"), "/guests"));
let status = std::process::Command::new("cargo")
.args([
"build",
@@ -51,10 +51,7 @@ impl TestWorld {
Self(root)
}
async fn start(&self) -> Host {
let cache = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.join("target/core/console-cache");
let cache = PathBuf::from(concat!(env!("CARGO_TARGET_TMPDIR"), "/cache"));
Host::start_with_cache(&self.0, &cache).await.unwrap()
}
}