summaryrefslogtreecommitdiff
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 21:52:24 -0700
commitf8b966f08614ad0516c57858cbe61fb49ec2985a (patch)
treef61b465c0da345ae4d7fc4ef1ba3ad3473c9e0a5
parent78c14d901bab6682f6b926558f0bac38822e4f79 (diff)
downloadliburing-f8b966f08614ad0516c57858cbe61fb49ec2985a.tar.gz
liburing-f8b966f08614ad0516c57858cbe61fb49ec2985a.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>
-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;