public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] msgstress01: remove TWARN type from runtime remaining
@ 2024-06-25 10:01 Li Wang
  2024-06-26 13:39 ` Cyril Hrubis
  0 siblings, 1 reply; 11+ messages in thread
From: Li Wang @ 2024-06-25 10:01 UTC (permalink / raw)
  To: chrubis, ltp

To mask the issue where a warning is being treated as a failure in CI
logs, we modify the code to change the message type from TWARN to TINFO.

This warning easily happens especaill on debug/slower kernel:

    msgstress01.c:217: TWARN: Out of runtime during forking...

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/syscalls/ipc/msgstress/msgstress01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
index 8b1e9a8c0..9f0ba105d 100644
--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
@@ -214,7 +214,7 @@ static void run(void)
 			break;
 
 		if (!tst_remaining_runtime()) {
-			tst_res(TWARN, "Out of runtime during forking...");
+			tst_res(TINFO, "Warning: Out of runtime during forking...");
 			*stop = 1;
 			break;
 		}
-- 
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH] msgstress01: remove TWARN type from runtime remaining
  2024-06-25 10:01 [LTP] [PATCH] msgstress01: remove TWARN type from runtime remaining Li Wang
@ 2024-06-26 13:39 ` Cyril Hrubis
  2024-06-27  2:41   ` Li Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2024-06-26 13:39 UTC (permalink / raw)
  To: Li Wang; +Cc: ltp

Hi!
> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>  testcases/kernel/syscalls/ipc/msgstress/msgstress01.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> index 8b1e9a8c0..9f0ba105d 100644
> --- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> +++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> @@ -214,7 +214,7 @@ static void run(void)
>  			break;
>  
>  		if (!tst_remaining_runtime()) {
> -			tst_res(TWARN, "Out of runtime during forking...");
> +			tst_res(TINFO, "Warning: Out of runtime during forking...");

Maybe this should be a TCONF instead, since we were not able to run the
test because the kernel is too slow...

>  			*stop = 1;
>  			break;
>  		}
> -- 
> 2.45.2
> 

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH] msgstress01: remove TWARN type from runtime remaining
  2024-06-26 13:39 ` Cyril Hrubis
@ 2024-06-27  2:41   ` Li Wang
  2024-06-27  3:14     ` [LTP] [PATCH v2] msgstress01: remove TWARN " Li Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Li Wang @ 2024-06-27  2:41 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Cyril Hrubis <chrubis@suse.cz> wrote:


> > --- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> > +++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> > @@ -214,7 +214,7 @@ static void run(void)
> >                       break;
> >
> >               if (!tst_remaining_runtime()) {
> > -                     tst_res(TWARN, "Out of runtime during forking...");
> > +                     tst_res(TINFO, "Warning: Out of runtime during
> forking...");
>
> Maybe this should be a TCONF instead, since we were not able to run the
> test because the kernel is too slow...
>

Yeah, good point, once the '*stop' set to 1 the rest process doesn't
get perform as well, so TCONF should be better.

-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining
  2024-06-27  2:41   ` Li Wang
@ 2024-06-27  3:14     ` Li Wang
  2024-06-27 11:40       ` Cyril Hrubis
  0 siblings, 1 reply; 11+ messages in thread
From: Li Wang @ 2024-06-27  3:14 UTC (permalink / raw)
  To: ltp, chrubis

To mask the issue where a warning is being treated as a failure in CI
logs, we modify the code to change the message type from TWARN to TCONF.

Additionally, we refine the condition under which the test reports as
PASS to ensure that it also accounts for the `stop` flag. This prevents
the test from incorrectly reporting success when it had to stop due to
runtime constraints.

This warning easily happens especaill on debug/slower kernel:

    msgstress01.c:217: TWARN: Out of runtime during forking...

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/syscalls/ipc/msgstress/msgstress01.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
index 8b1e9a8c0..9231a0b5f 100644
--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
@@ -214,7 +214,7 @@ static void run(void)
 			break;
 
 		if (!tst_remaining_runtime()) {
-			tst_res(TWARN, "Out of runtime during forking...");
+			tst_res(TCONF, "Out of runtime during forking...");
 			*stop = 1;
 			break;
 		}
@@ -242,7 +242,7 @@ static void run(void)
 	tst_reap_children();
 	remove_queues();
 
-	if (!(*fail))
+	if (!(*fail) && !(*stop))
 		tst_res(TPASS, "Test passed. All messages have been received");
 }
 
-- 
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining
  2024-06-27  3:14     ` [LTP] [PATCH v2] msgstress01: remove TWARN " Li Wang
@ 2024-06-27 11:40       ` Cyril Hrubis
  2024-06-27 11:46         ` Li Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2024-06-27 11:40 UTC (permalink / raw)
  To: Li Wang; +Cc: ltp

Hi!
> To mask the issue where a warning is being treated as a failure in CI
> logs, we modify the code to change the message type from TWARN to TCONF.
> 
> Additionally, we refine the condition under which the test reports as
> PASS to ensure that it also accounts for the `stop` flag. This prevents
> the test from incorrectly reporting success when it had to stop due to
> runtime constraints.
> 
> This warning easily happens especaill on debug/slower kernel:
> 
>     msgstress01.c:217: TWARN: Out of runtime during forking...
> 
> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>  testcases/kernel/syscalls/ipc/msgstress/msgstress01.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> index 8b1e9a8c0..9231a0b5f 100644
> --- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> +++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> @@ -214,7 +214,7 @@ static void run(void)
>  			break;
>  
>  		if (!tst_remaining_runtime()) {
> -			tst_res(TWARN, "Out of runtime during forking...");
> +			tst_res(TCONF, "Out of runtime during forking...");

This part looks good.

>  			*stop = 1;
>  			break;
>  		}
> @@ -242,7 +242,7 @@ static void run(void)
>  	tst_reap_children();
>  	remove_queues();
>  
> -	if (!(*fail))
> +	if (!(*fail) && !(*stop))
>  		tst_res(TPASS, "Test passed. All messages have been received");

However this would cause the test to report TBROK in the case that we
ended up out of runtime in the second for loop because in that case no
results will be reported by the test.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining
  2024-06-27 11:40       ` Cyril Hrubis
@ 2024-06-27 11:46         ` Li Wang
  2024-06-27 11:47           ` Cyril Hrubis
  0 siblings, 1 reply; 11+ messages in thread
From: Li Wang @ 2024-06-27 11:46 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

On Thu, Jun 27, 2024 at 7:40 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > To mask the issue where a warning is being treated as a failure in CI
> > logs, we modify the code to change the message type from TWARN to TCONF.
> >
> > Additionally, we refine the condition under which the test reports as
> > PASS to ensure that it also accounts for the `stop` flag. This prevents
> > the test from incorrectly reporting success when it had to stop due to
> > runtime constraints.
> >
> > This warning easily happens especaill on debug/slower kernel:
> >
> >     msgstress01.c:217: TWARN: Out of runtime during forking...
> >
> > Signed-off-by: Li Wang <liwang@redhat.com>
> > ---
> >  testcases/kernel/syscalls/ipc/msgstress/msgstress01.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> > index 8b1e9a8c0..9231a0b5f 100644
> > --- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> > +++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
> > @@ -214,7 +214,7 @@ static void run(void)
> >                       break;
> >
> >               if (!tst_remaining_runtime()) {
> > -                     tst_res(TWARN, "Out of runtime during forking...");
> > +                     tst_res(TCONF, "Out of runtime during forking...");
>
> This part looks good.
>
> >                       *stop = 1;
> >                       break;
> >               }
> > @@ -242,7 +242,7 @@ static void run(void)
> >       tst_reap_children();
> >       remove_queues();
> >
> > -     if (!(*fail))
> > +     if (!(*fail) && !(*stop))
> >               tst_res(TPASS, "Test passed. All messages have been
> received");
>
> However this would cause the test to report TBROK in the case that we
> ended up out of runtime in the second for loop because in that case no
> results will be reported by the test.
>


Ah yes, but if the second runtime out happens, it still
not get an expected result on the test, so maybe we
shouldn't print "TPASS + All messages received"?


-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining
  2024-06-27 11:46         ` Li Wang
@ 2024-06-27 11:47           ` Cyril Hrubis
  2024-06-27 11:59             ` Li Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2024-06-27 11:47 UTC (permalink / raw)
  To: Li Wang; +Cc: ltp

Hi!
> Ah yes, but if the second runtime out happens, it still
> not get an expected result on the test, so maybe we
> shouldn't print "TPASS + All messages received"?

I suppose that we can print "Some messages received" instead in the case
that stop was in the second loop.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining
  2024-06-27 11:47           ` Cyril Hrubis
@ 2024-06-27 11:59             ` Li Wang
  2024-06-27 12:04               ` Cyril Hrubis
  0 siblings, 1 reply; 11+ messages in thread
From: Li Wang @ 2024-06-27 11:59 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

On Thu, Jun 27, 2024 at 7:48 PM Cyril Hrubis <chrubis@suse.cz> wrote:

> Hi!
> > Ah yes, but if the second runtime out happens, it still
> > not get an expected result on the test, so maybe we
> > shouldn't print "TPASS + All messages received"?
>
> I suppose that we can print "Some messages received" instead in the case
> that stop was in the second loop.
>

How about giving the actual finished numbers?

        if (!(*fail))
-               tst_res(TPASS, "Test passed. All messages have been
received");
+               tst_res(TPASS, "Test passed. %d messages have been
received", *finished);


-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining
  2024-06-27 11:59             ` Li Wang
@ 2024-06-27 12:04               ` Cyril Hrubis
  2024-06-27 12:15                 ` Li Wang
  0 siblings, 1 reply; 11+ messages in thread
From: Cyril Hrubis @ 2024-06-27 12:04 UTC (permalink / raw)
  To: Li Wang; +Cc: ltp

Hi!
> How about giving the actual finished numbers?
> 
>         if (!(*fail))
> -               tst_res(TPASS, "Test passed. All messages have been
> received");
> +               tst_res(TPASS, "Test passed. %d messages have been
> received", *finished);

This is not the number of messages though, it's incremented by writer
threads once they send num_iteration messages. So most of the time it
will either be 0 if we had to stop the execution because of runtime, or
2 * num_messages, if we managed finish in time.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining
  2024-06-27 12:04               ` Cyril Hrubis
@ 2024-06-27 12:15                 ` Li Wang
  2024-06-27 12:53                   ` Cyril Hrubis
  0 siblings, 1 reply; 11+ messages in thread
From: Li Wang @ 2024-06-27 12:15 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp

Cyril Hrubis <chrubis@suse.cz> wrote:

This is not the number of messages though, it's incremented by writer
> threads once they send num_iteration messages. So most of the time it
> will either be 0 if we had to stop the execution because of runtime, or
> 2 * num_messages, if we managed finish in time.
>

Make sense!

I modified the patch and pushed it like this:

--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
@@ -214,7 +214,7 @@ static void run(void)
                        break;

                if (!tst_remaining_runtime()) {
-                       tst_res(TWARN, "Out of runtime during forking...");
+                       tst_res(TCONF, "Out of runtime during forking...");
                        *stop = 1;
                        break;
                }
@@ -243,7 +243,7 @@ static void run(void)
        remove_queues();

        if (!(*fail))
-               tst_res(TPASS, "Test passed. All messages have been
received");
+               tst_res(TPASS, "Some messages received");
 }



-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining
  2024-06-27 12:15                 ` Li Wang
@ 2024-06-27 12:53                   ` Cyril Hrubis
  0 siblings, 0 replies; 11+ messages in thread
From: Cyril Hrubis @ 2024-06-27 12:53 UTC (permalink / raw)
  To: Li Wang; +Cc: ltp

Hi!
>         if (!(*fail))
> -               tst_res(TPASS, "Test passed. All messages have been
> received");
> +               tst_res(TPASS, "Some messages received");

We could have done:

		if (*stop)
			tst_res(TPASS, "Some messages received");
		else
			tst_res(TPASS, "All messages received");

But I guess that in the end nobody will read the logs as long as the
test succeeds...

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-27 12:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-25 10:01 [LTP] [PATCH] msgstress01: remove TWARN type from runtime remaining Li Wang
2024-06-26 13:39 ` Cyril Hrubis
2024-06-27  2:41   ` Li Wang
2024-06-27  3:14     ` [LTP] [PATCH v2] msgstress01: remove TWARN " Li Wang
2024-06-27 11:40       ` Cyril Hrubis
2024-06-27 11:46         ` Li Wang
2024-06-27 11:47           ` Cyril Hrubis
2024-06-27 11:59             ` Li Wang
2024-06-27 12:04               ` Cyril Hrubis
2024-06-27 12:15                 ` Li Wang
2024-06-27 12:53                   ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox