All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1] connectors/cn_pec: improve reliability
Date: Fri, 6 Aug 2021 09:48:44 +0200	[thread overview]
Message-ID: <YQzpXHDvFmoaSFhi@pevik> (raw)
In-Reply-To: <20210805140806.3884-1-bogdan.lezhepekov@suse.com>

Hi Bogdan, Joerg,
> Sometimes pec_listener has not enough time to handle all
> the generated events.

> This patch only returns back the delay that was removed
> in a recent patch.

> Signed-off-by: Bogdan Lezhepekov <bogdan.lezhepekov@suse.com>
> ---
>  testcases/kernel/connectors/pec/cn_pec.sh | 2 ++
>  1 file changed, 2 insertions(+)

> diff --git a/testcases/kernel/connectors/pec/cn_pec.sh b/testcases/kernel/connectors/pec/cn_pec.sh
> index 9b85a5c81..24b1db761 100755
> --- a/testcases/kernel/connectors/pec/cn_pec.sh
> +++ b/testcases/kernel/connectors/pec/cn_pec.sh
> @@ -77,6 +77,8 @@ test()
>  	tst_sleep 100ms

>  	ROD event_generator -n $num_events -e $event \>gen_$event.log 2\>gen_$event.err
> +    # sleep until pec_listener has seen and handled all of the generated events
> +    tst_sleep 100ms
nit: mixing tabs and spaces (script uses tabs), can be fixed during merge.

If I understand the code correctly, pec_listener keeps receiving msg from PEC
until got signaled by kill. We generally try to avoid sleep in tests [1].

@Joerg: I'm not sure if it's reasonable to add another signal handler in which
pec_listener would print number of already handled requests (with write() as
printf() is not reentrant). Then we could loop for certain time before sending INT.

Kind regards,
Petr

[1] https://people.kernel.org/metan/why-sleep-is-almost-never-acceptable-in-tests

>  	kill -s INT $pid 2> /dev/null
>  	wait $pid

  parent reply	other threads:[~2021-08-06  7:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 14:08 [LTP] [PATCH v1] connectors/cn_pec: improve reliability Bogdan Lezhepekov
2021-08-06  4:35 ` Joerg Vehlow
2021-08-06  7:48 ` Petr Vorel [this message]
2021-08-06  8:14   ` Joerg Vehlow
2021-08-06  9:06     ` Bogdan Lezhepekov
2021-08-06  9:21       ` Joerg Vehlow

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=YQzpXHDvFmoaSFhi@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.