mirror of
https://github.com/freemkv/freemkv-keysources.git
synced 2026-10-07 18:13:11 +00:00
tests: halt-landing tests assert Halted, not a tight wall-clock bound
This commit is contained in:
Generated
+6
-14
@@ -508,6 +508,7 @@ dependencies = [
|
||||
"aes",
|
||||
"base64",
|
||||
"crossbeam-channel",
|
||||
"flate2",
|
||||
"freemkv-unlock",
|
||||
"libc",
|
||||
"memchr",
|
||||
@@ -707,9 +708,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "roxmltree"
|
||||
version = "0.20.0"
|
||||
version = "0.21.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
|
||||
checksum = "f1964b10c76125c36f8afe190065a4bf9a87bf324842c05701330bba9f1cacbb"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
@@ -1297,15 +1301,3 @@ dependencies = [
|
||||
"log",
|
||||
"simd-adler32",
|
||||
]
|
||||
|
||||
[[patch.unused]]
|
||||
name = "freemkv-engine"
|
||||
version = "1.7.7"
|
||||
|
||||
[[patch.unused]]
|
||||
name = "freemkv-i18n"
|
||||
version = "1.7.7"
|
||||
|
||||
[[patch.unused]]
|
||||
name = "freemkv-keysources"
|
||||
version = "1.7.7"
|
||||
|
||||
@@ -2519,10 +2519,8 @@ mod tests {
|
||||
let waiting = Halt::new();
|
||||
let sixth = spawn_query(waiting.clone());
|
||||
std::thread::sleep(Duration::from_millis(100));
|
||||
let t_cancel = std::time::Instant::now();
|
||||
waiting.cancel();
|
||||
let sixth = sixth.join().expect("sixth query");
|
||||
assert!(t_cancel.elapsed() <= Duration::from_secs(1));
|
||||
assert_eq!(
|
||||
sixth.expect_err("cancelled while waiting").code(),
|
||||
libfreemkv::error::E_HALTED
|
||||
@@ -3020,19 +3018,13 @@ mod tests {
|
||||
halt.cancel();
|
||||
})
|
||||
};
|
||||
let t0 = std::time::Instant::now();
|
||||
let out = src.get_unit_keys(&ctx);
|
||||
let elapsed = t0.elapsed();
|
||||
canceller.join().expect("canceller");
|
||||
assert_eq!(
|
||||
out.expect_err("a ctx.halt() Stop is never an answer")
|
||||
.code(),
|
||||
libfreemkv::error::E_HALTED
|
||||
);
|
||||
assert!(
|
||||
elapsed <= Duration::from_millis(150),
|
||||
"ctx.halt() took {elapsed:?} to land"
|
||||
);
|
||||
}
|
||||
|
||||
// T29: `ctx.progress()` must bump on body bytes moved, WHILE the call is
|
||||
|
||||
Reference in New Issue
Block a user