From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: Martin Doucha <martin.doucha@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] lib: multiply the timeout if detect slow kconfigsD
Date: Mon, 6 Jan 2025 17:19:59 +0100 [thread overview]
Message-ID: <Z3wCr3LG_ztyQYHj@yuki.lan> (raw)
In-Reply-To: <20250106153624.GB323533@pevik>
Hi!
> And if value does not get changed it's the default value. Also name is a bit
> confusing (you suggest to have members "timeout", "runtime"), which suggest the
> special value is related to both.
>
> OK, flag which would allow us to see that time will be changed.
>
> > Then all long running test would have either tst_test->timeout or
> > tst_test->runtime set.
>
> > Technically we would need two special timeout values
> > TST_UNLIMITED_TIMEOUT and TST_RUNTIME_TIMEOUT.
>
> OK, TST_UNLIMITED_TIMEOUT is equivalent of:
>
> #define TST_UNLIMITED_RUNTIME (-1)
>
> Maybe have just single definition TST_UNLIMITED, which could be used in both
> tst_test->timeout and tst_test->runtime? But that's just an implementation
> detail.
The UNLIMITED_RUNTIME would not be needed anymore. Because runtime will
mean _only_ for how long will a few tests spend in the main loop.
Infinite loop does not make any sense. The tst_runtime will be basically
renamed to timeout and TST_UNLIMITED_RUNTIME becomes
TST_UNLIMITED_TIMEOUT.
> > > > Maybe we should have called the max_runtime a timeout and add runtime
> > > > for tests that needs it. That way we would have timeout compromising of
> > > > two parts, one would be the 30s that is used for all tests and second
> > > > part from the tst_test structure. And then the sum of these two would be
> > > > multiplied by the timeout multipliers. Then we would have a runtime,
> > > > which would be used only by tests that call tst_remaining_runtime().
>
> OK, the point of whole change is to separate some general timeout (30 sec) from
> runtime (used for tst_remaining_runtime()), right?
The point is to separate timeout, which is a guess on upper bound on the
time the test will spend executing from a runtime which is the exact
time a few tests will spend looping in the test function.
> > > > The overall test timeout would be then:
>
> > > > (default_30s_timeout + tst_test->timeout) * TIMEOUT_MUL + tst_test->runtime * RUNTIME_MUL
>
> (default_30s_timeout + tst_test->timeout) * TIMEOUT_MUL is meant for setup or
> cleanup and library overhead, tst_test->runtime * RUNTIME_MUL for running test
> function?
No, it's the other way around. The timeout is a guessed upper bound for
a test execution time. It's for everything the test does and in most of
the cases only the default timeout (which is kind of safety measure) is
sufficient. Then there are tests that do some work that is not time
bound, e.g. I/O. In that case we set the timeout in the tst_test
structure to some value we measured in practice and that plus the
default timeout will become the overall test timeout.
Then we have a few testcases that do a loop in the test function that
takes exact time. In that case we know that we spend exactly runtime in
the test function, but there is a setup and cleanup as well. So we add
the default timeout to the runtime to get the overall timeout. There may
be also a case where the test setup for such test takes some time, in
that case we would set both the timeout and runtime in the tst_test
structure. The timeout would be upper bound for the test setup and
runtime would be exactly for how long will the test function loop.
Mainly this would make sure that if timeout part of the overall test
time limit gets multiplied, because we are running on a slow system, the
runtime will not. Because we could control the timeout and runtime
separately.
> > Not only, the default 30s timeout is for the whole testrun for tests
> > that are quick enough. We have a lot of tests that run just for less
> > than 1s even on small embedded boards.
>
> And yes, with properly set data, 30s could be carefully lowered down a bit.
That was my long term plan.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-01-06 16:20 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-22 7:22 [LTP] [PATCH 1/2] lib: multiply the timeout if detect slow kconfigs Li Wang
2024-12-22 7:22 ` [LTP] [PATCH 2/2] starvation: skip test on slow kernel Li Wang
2025-01-02 12:56 ` Petr Vorel
2025-01-02 14:31 ` Petr Vorel
2025-01-03 7:53 ` Li Wang
2025-01-02 12:43 ` [LTP] [PATCH 1/2] lib: multiply the timeout if detect slow kconfigs Petr Vorel
2025-01-03 5:00 ` Li Wang
2025-01-03 7:06 ` Petr Vorel
2025-01-03 7:33 ` Petr Vorel
2025-01-03 7:58 ` Li Wang
2025-01-03 15:48 ` [LTP] [PATCH 1/2] lib: multiply the timeout if detect slow kconfigsD Cyril Hrubis
2025-01-04 3:38 ` Li Wang
2025-01-06 9:35 ` Petr Vorel
2025-01-06 12:10 ` Cyril Hrubis
2025-01-06 12:52 ` Petr Vorel
2025-01-06 13:39 ` Cyril Hrubis
2025-01-06 15:36 ` Petr Vorel
2025-01-06 16:19 ` Cyril Hrubis [this message]
2025-01-07 5:37 ` Li Wang
2025-01-07 6:28 ` Li Wang
2025-01-07 12:42 ` Cyril Hrubis
2025-01-07 16:49 ` Petr Vorel
2025-01-08 1:47 ` Li Wang
2025-01-08 2:51 ` Li Wang
2025-01-06 16:03 ` Martin Doucha
2025-01-06 16:21 ` Cyril Hrubis
2025-01-06 16:49 ` Martin Doucha
2025-01-15 22:41 ` [LTP] [REGRESSION] Broken tests using tst_net.sh by 893ca0abe7 (was: [PATCH 1/2] lib: multiply the timeout if detect slow kconfigs) Petr Vorel
2025-01-16 6:54 ` Li Wang
2025-01-16 8:35 ` Petr Vorel
2025-01-16 8:38 ` Petr Vorel
2025-01-16 12:10 ` Li Wang
2025-01-16 12:13 ` Li Wang
2025-01-16 13:13 ` Petr Vorel
2025-01-16 12:56 ` Petr Vorel
2025-01-20 9:07 ` [LTP] [REGRESSION] pidns05 timeout " Petr Vorel
2025-01-20 9:11 ` Petr Vorel
2025-01-20 10:18 ` Li Wang
2025-01-20 12:29 ` Cyril Hrubis
2025-01-20 13:03 ` Petr Vorel
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=Z3wCr3LG_ztyQYHj@yuki.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
--cc=martin.doucha@suse.com \
--cc=pvorel@suse.cz \
/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