diff mbox series

[04/10] ioctl_sg01: Set unlimited max_runtime

Message ID 20220830135007.16818-5-mdoucha@suse.cz
State Changes Requested
Headers show
Series Max_runtime and other minor fixes | expand

Commit Message

Martin Doucha Aug. 30, 2022, 1:50 p.m. UTC
Test setup can take very long time depending on the amount of free RAM.
Set unlimited max_runtime to avoid timeout issues.

Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/kernel/syscalls/ioctl/ioctl_sg01.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Cyril Hrubis Aug. 30, 2022, 3:16 p.m. UTC | #1
Hi!
> Test setup can take very long time depending on the amount of free RAM.
> Set unlimited max_runtime to avoid timeout issues.

I would rather go for large enough number e.g. 30 minutes than
unlimited as the unlimited runtime turns off the timeouts and such test
can run undefinitely.

The unlimited runtime is really meant for unpredictable tests, such as
OOM testcases.

> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/kernel/syscalls/ioctl/ioctl_sg01.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/testcases/kernel/syscalls/ioctl/ioctl_sg01.c b/testcases/kernel/syscalls/ioctl/ioctl_sg01.c
> index 94b30dc6b..4a5b0f35e 100644
> --- a/testcases/kernel/syscalls/ioctl/ioctl_sg01.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl_sg01.c
> @@ -126,6 +126,7 @@ static struct tst_test test = {
>  	.test_all = run,
>  	.setup = setup,
>  	.cleanup = cleanup,
> +	.max_runtime = TST_UNLIMITED_RUNTIME,
>  	.tags = (const struct tst_tag[]) {
>  		{"linux-git", "a45b599ad808"},
>  		{"CVE", "2018-1000204"},
> -- 
> 2.37.2
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp
Martin Doucha Aug. 30, 2022, 3:23 p.m. UTC | #2
On 30. 08. 22 17:16, Cyril Hrubis wrote:
> Hi!
>> Test setup can take very long time depending on the amount of free RAM.
>> Set unlimited max_runtime to avoid timeout issues.
> 
> I would rather go for large enough number e.g. 30 minutes than
> unlimited as the unlimited runtime turns off the timeouts and such test
> can run undefinitely.

Even setting max_runtime is an ugly hack here because the test itself is 
nearly instant. The setup() function is what actually times out. But 
there's currently no way to change the default 30 second timeout 
allocated for setup() and cleanup(). It'd be much better if I could set 
that setup() has unlimited timeout and the test itself is limited to 5 
seconds.
Cyril Hrubis Aug. 30, 2022, 6:38 p.m. UTC | #3
Hi!
> >> Test setup can take very long time depending on the amount of free RAM.
> >> Set unlimited max_runtime to avoid timeout issues.
> > 
> > I would rather go for large enough number e.g. 30 minutes than
> > unlimited as the unlimited runtime turns off the timeouts and such test
> > can run undefinitely.
> 
> Even setting max_runtime is an ugly hack here because the test itself is 
> nearly instant. The setup() function is what actually times out. But 
> there's currently no way to change the default 30 second timeout 
> allocated for setup() and cleanup(). It'd be much better if I could set 
> that setup() has unlimited timeout and the test itself is limited to 5 
> seconds.

I guess that we can add setup_max_runtime and cleanup_max_runtime
however I would still set the setup_max_runtime to a large but finite
value here.
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/ioctl/ioctl_sg01.c b/testcases/kernel/syscalls/ioctl/ioctl_sg01.c
index 94b30dc6b..4a5b0f35e 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_sg01.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_sg01.c
@@ -126,6 +126,7 @@  static struct tst_test test = {
 	.test_all = run,
 	.setup = setup,
 	.cleanup = cleanup,
+	.max_runtime = TST_UNLIMITED_RUNTIME,
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "a45b599ad808"},
 		{"CVE", "2018-1000204"},