Skip to content
Commit aed5a8df authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Christian Brauner
Browse files

tests: add pidfd poll tests



This adds testing for polling on pidfd of a process being killed. Test runs
10000 iterations by default to stress test pidfd polling functionality.
It accepts an optional command-line parameter to override the number or
iterations to run.
Specifically, it tests for:
- pidfd_open on a child process succeeds
- pidfd_send_signal on a child process succeeds
- polling on pidfd succeeds and returns exactly one event
- returned event is POLLIN
- event is received within 3 secs of the process being killed

10000 iterations was chosen because of the race condition being tested
which is not consistently reproducible but usually is revealed after less
than 2000 iterations.
Reveals race fixed by commit b191d649 ("pidfd: fix a poll race when setting exit_state")

Signed-off-by: default avatarSuren Baghdasaryan <surenb@google.com>
Link: https://lore.kernel.org/r/20190726162226.252750-2-surenb@google.com


Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 2ec2f99a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment