[LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining

Li Wang liwang@redhat.com
Thu Jun 27 13:46:29 CEST 2024


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


More information about the ltp mailing list