summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-02-25 15:28:33 -0700
committerJens Axboe <axboe@kernel.dk>2020-02-25 15:28:33 -0700
commit98f6ebd52bfeb4217ba8a250c53586d8a594c36d (patch)
treece03aa2bfce1090c5e8af14e905f4832d4792568 /test
parentab77833396b311bb43f2b57d035275877afadf37 (diff)
downloadliburing-98f6ebd52bfeb4217ba8a250c53586d8a594c36d.tar.gz
liburing-98f6ebd52bfeb4217ba8a250c53586d8a594c36d.tar.bz2
test/sq-poll-kthread: include grace period before thread check
Files can be put async, which means that it may very well be that the thread is alive the instant after io_uring_queue_exit() has returned. Add a 1 second grace period before checking, hopefully that's enough to remove false positives from this test. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test')
-rw-r--r--test/sq-poll-kthread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/sq-poll-kthread.c b/test/sq-poll-kthread.c
index d53605c..37f0b0f 100644
--- a/test/sq-poll-kthread.c
+++ b/test/sq-poll-kthread.c
@@ -118,7 +118,8 @@ err_pipe:
return ret;
}
-int test_sq_poll_kthread_stopped(bool do_exit) {
+int test_sq_poll_kthread_stopped(bool do_exit)
+{
pid_t pid;
int status = 0;
@@ -133,6 +134,7 @@ int test_sq_poll_kthread_stopped(bool do_exit) {
if (status != 0)
return WEXITSTATUS(status);
+ sleep(1);
if (system("ps --ppid 2 | grep " KTHREAD_NAME) == 0) {
fprintf(stderr, "%s kthread still running!\n", KTHREAD_NAME);
return TEST_FAILED;