[LTP] [PATCH] lib: Print failure hints only once to reduce log duplication
Li Wang
liwang@redhat.com
Thu Oct 31 03:33:43 CET 2024
On Wed, Oct 30, 2024 at 8:15 PM Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
> > > The LTP test currently prints failure hints multiple times if a test
> > > encounters several TFAIL or TBROK results. This leads to unnecessarily
> > > verbose and duplicated logs.
> > >
> > > This patch modifies the `print_failure_hints()` function to ensure that
> > > failure hints are printed only once per test run. By setting
> `show_failure_hints`
> > > to 0 after the first print, subsequent calls to `print_failure_hints()`
> > > will not produce redundant output.
> >
> > Hmm, we do call print_failure_hints() from do_exit() that calls exit()
> > at the end of the function. We shouldn't print the hints twice, what do
> > I miss?
>
> Ah, right, we have two if () conditions that call the function in there,
> so yes, we may print it twice.
>
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
>
Pushed, thank you both.
--
Regards,
Li Wang
More information about the ltp
mailing list