[LTP] [PATCH V3] lib: redefine the overall timeout logic of test
Cyril Hrubis
chrubis@suse.cz
Fri Jan 10 16:24:30 CET 2025
Hi!
> Notes:
> Changes V2 --> V3:
> * Improve timeout description based on Cyril's suggestion
> * Move .runtime to .timeout for some tests (fsplough, ksm02, ksm04)
> * Drop the changes on shell test test_timeout.sh
> * Squash tst_set_timeout and set_mempolicy01 patches into the first one
> * Double the duration of a single test iteration on an RPi4 and use that
> value to set .timeout for readahead02 test
Here you say timeout
> diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c
> index a109573fe..412784dbb 100644
> --- a/testcases/kernel/syscalls/readahead/readahead02.c
> +++ b/testcases/kernel/syscalls/readahead/readahead02.c
> @@ -318,19 +318,6 @@ static void test_readahead(unsigned int n)
> tst_res(TCONF, "Page cache on your system is too small "
> "to hold whole testfile.");
> }
> -
> - /*
> - * The time consuming of readahead quite depending on the platform IO
> - * speed, sometime test timeout when the default max_runtime is used up.
> - *
> - * readahead02.c:221: TINFO: Test #2: POSIX_FADV_WILLNEED on file
> - * readahead02.c:285: TINFO: read_testfile(0) took: 26317623 usec
> - * readahead02.c:286: TINFO: read_testfile(1) took: 26101484 usec
> - *
> - * Here raise the maximum runtime dynamically.
> - */
> - if ((tc+1)->readahead)
> - tst_set_max_runtime(test.max_runtime + (usec + usec_ra) / 1000000);
> }
>
>
> @@ -381,7 +368,7 @@ static void setup(void)
> {
> if (opt_fsizestr) {
> testfile_size = SAFE_STRTOL(opt_fsizestr, 1, INT_MAX);
> - tst_set_max_runtime(1 + testfile_size / (DEFAULT_FILESIZE/32));
> + tst_set_runtime(1 + testfile_size / (DEFAULT_FILESIZE/32));
> }
>
> if (access(PROC_IO_FNAME, F_OK))
> @@ -422,7 +409,7 @@ static struct tst_test test = {
> },
> .test = test_readahead,
> .tcnt = ARRAY_SIZE(tcases),
> - .max_runtime = 30,
> + .runtime = 60,
But you actually set runtime instead.
> .tags = (const struct tst_tag[]) {
> {"linux-git", "b833a3660394"},
> {"linux-git", "5b910bd615ba"},
Otherwise:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list