[LTP] [PATCH] preadv203: set max_runtime to 270s
Cyril Hrubis
chrubis@suse.cz
Wed May 25 10:21:20 CEST 2022
Hi!
> Before the runtime patchset preadv203 use 5min as default timeout
> per fs, that's really long enough for prepare_device(). But after
> that, its now only has 30s which might be short for a slower system
> to do preparation work.
>
> Let's set max_runtime to 270s to make the timeout at least equal
> to previously.
Isn't the main reason why the test fails that the verify_preadv2()
function spins for at most 60 seconds?
I guess that the proper solution should be:
diff --git a/testcases/kernel/syscalls/preadv2/preadv203.c b/testcases/kernel/syscalls/preadv2/preadv203.c
index 01622ad15..e9377071e 100644
--- a/testcases/kernel/syscalls/preadv2/preadv203.c
+++ b/testcases/kernel/syscalls/preadv2/preadv203.c
@@ -199,7 +199,6 @@ static void *cache_dropper(void *unused)
static void verify_preadv2(void)
{
pthread_t reader, dropper, writer;
- unsigned int max_runtime = 600;
void *eagains;
stop = 0;
@@ -210,7 +209,7 @@ static void verify_preadv2(void)
SAFE_PTHREAD_CREATE(&reader, NULL, nowait_reader, NULL);
SAFE_PTHREAD_CREATE(&writer, NULL, writer_thread, NULL);
- while (!stop && max_runtime-- > 0)
+ while (!stop && tst_remaining_runtime())
usleep(100000);
stop = 1;
@@ -280,4 +279,5 @@ static struct tst_test test = {
.mount_device = 1,
.all_filesystems = 1,
.needs_root = 1,
+ .max_runtime = 60,
};
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list