Skip to content

Commit

Permalink
Stabilize ensure_execute_processes_have_correct_num_threads test (#…
Browse files Browse the repository at this point in the history
…7253)

Saw this test flake a few times, last time
[here](https://github.com/paritytech/polkadot-sdk/actions/runs/12834432188/job/35791830215).

We first fetch all processes in the test, then query `/proc/<pid>/stat`
for every one of them. When the file was not found, we would error. Now
we tolerate not finding this file. Ran 200 times locally without error,
before would fail a few times, probably depending on process fluctuation
(which I expect to be high on CI runners).
  • Loading branch information
skunert authored Jan 20, 2025
1 parent 4937f77 commit d5d9b12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion polkadot/node/core/pvf/tests/it/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ fn find_process_by_sid_and_name(

let mut found = None;
for process in all_processes {
let stat = process.stat().expect("/proc existed above. Potential race occurred");
let Ok(stat) = process.stat() else {
continue;
};

if stat.session != sid || !process.exe().unwrap().to_str().unwrap().contains(exe_name) {
continue
Expand Down

0 comments on commit d5d9b12

Please sign in to comment.