sysinfo - make test-wait-non-child more robust.
Peter Michael Green
1 year, 4 months ago
|
0 |
rust-sysinfo (0.26.7-2) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
|
|
1 |
|
|
2 |
* Team upload.
|
|
3 |
* Package sysinfo 0.26.7 from crates.io using debcargo 2.6.0
|
|
4 |
* Make test_wait_non_child more robust, hopefully fixing sporadic failures
|
|
5 |
on arm*.
|
|
6 |
|
|
7 |
-- Peter Michael Green <plugwash@debian.org> Sat, 17 Dec 2022 17:37:09 +0000
|
|
8 |
|
0 | 9 |
rust-sysinfo (0.26.7-1) unstable; urgency=medium
|
1 | 10 |
|
2 | 11 |
* Team upload.
|
|
0 |
Index: sysinfo/tests/process.rs
|
|
1 |
===================================================================
|
|
2 |
--- sysinfo.orig/tests/process.rs
|
|
3 |
+++ sysinfo/tests/process.rs
|
|
4 |
@@ -489,6 +489,8 @@ fn test_wait_non_child() {
|
|
5 |
return;
|
|
6 |
}
|
|
7 |
|
|
8 |
+ let before = std::time::Instant::now();
|
|
9 |
+
|
|
10 |
// spawn non child process.
|
|
11 |
let p = if !cfg!(target_os = "linux") {
|
|
12 |
return;
|
|
13 |
@@ -503,8 +505,6 @@ fn test_wait_non_child() {
|
|
14 |
};
|
|
15 |
let pid = Pid::from_u32(p.id());
|
|
16 |
|
|
17 |
- let before = std::time::Instant::now();
|
|
18 |
-
|
|
19 |
let mut s = sysinfo::System::new();
|
|
20 |
s.refresh_process(pid);
|
|
21 |
let process = s.process(pid).expect("Process not found!");
|
|
22 |
@@ -516,6 +516,6 @@ fn test_wait_non_child() {
|
|
23 |
assert!(!s.refresh_process(pid));
|
|
24 |
|
|
25 |
// should wait for 2s.
|
|
26 |
- assert!(before.elapsed() > std::time::Duration::from_millis(2000));
|
|
27 |
- assert!(before.elapsed() < std::time::Duration::from_millis(3000));
|
|
28 |
+ assert!(before.elapsed() > std::time::Duration::from_millis(1900),"Elapsed time {:?} is not greater than 1900ms",before.elapsed());
|
|
29 |
+ assert!(before.elapsed() < std::time::Duration::from_millis(3000),"Elapsed time {:?} is not less than 3000ms",before.elapsed());
|
|
30 |
}
|
0 | 0 |
ignore-tests-failing-in-build-environment.diff
|
1 | 1 |
ignore-tests-failing-debci.diff
|
|
2 |
fix-race-in-test-wait-non-child.diff
|