From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it, Martin Doucha <martin.doucha@suse.com>
Subject: Re: [LTP] [RFC PATCh] lib: redefine the overall timeout logic of test
Date: Wed, 8 Jan 2025 10:18:11 +0100 [thread overview]
Message-ID: <Z35C00m6FwH8P8BI@yuki.lan> (raw)
In-Reply-To: <20250108071201.26984-1-liwang@redhat.com>
Hi!
> Key Concepts:
>
> timeout: Represents the time allocated for setup, cleanup, or other
> non-runtime parts of the test.
>
> runtime: The maximum runtime of the test's main execution loop. If
> exceeded, the test will exit early.
This is not entirely correct. I guess that we still didn't understand
each other. Let me try to explain once more.
The runtime is supposed to be used only in tests that call
tst_remaning_runtime() in the main loop to limit the test duration based
on runtime. This means that the test function execution time is always
the same (plus minus some rounding errors).
And the timeout is supposed to be upper bound for everything in the test
minus the part that is limited by the runtime.
So for the tests that use tst_remaining_runtime() the timeout guards the
setup and cleanup, but for tests that does not use
tst_remaining_runtime() the timeout limits the whole test run.
The reasoning behind this is that if for example we have a test where
the test function does I/O that is known to take up to 10s we want to
multiply this in the case of the debug kernel because the test function
may be slower.
On the other hand test function that has a loop that checks the remaning
runtime will do less iterations on debug kernel but the duration will be
the same. And we do not want to multiply this value because it will make
the test even slower on debug kernels.
The changes mostly looks okay, but some of the tests below that had
.max_runtime should replace that with .timeout instead. And we also
need tst_set_timeout() function for the testcases that try to figure out
the upper bound for the test duration in the test setup.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-01-08 9:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-08 7:12 [LTP] [RFC PATCh] lib: redefine the overall timeout logic of test Li Wang
2025-01-08 9:18 ` Cyril Hrubis [this message]
2025-01-08 10:49 ` Li Wang
2025-01-08 11:37 ` Li Wang
2025-01-08 12:33 ` Cyril Hrubis
2025-01-09 6:31 ` Li Wang
2025-01-09 7:50 ` Cyril Hrubis
2025-01-09 8:42 ` Li Wang
2025-01-09 8:51 ` Li Wang
2025-01-09 10:34 ` Cyril Hrubis
2025-01-09 10:45 ` Li Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z35C00m6FwH8P8BI@yuki.lan \
--to=chrubis@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
--cc=martin.doucha@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox