public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Wei Gao via ltp" <ltp@lists.linux.it>
Cc: kernel test robot <oliver.sang@intel.com>, Jan Kara <jack@suse.cz>
Subject: Re: [LTP] [PATCH v2] fanotify22.c: handle multiple asynchronous error events
Date: Mon, 09 Mar 2026 10:26:17 +0000	[thread overview]
Message-ID: <69aea049.050a0220.6a40f.4138@mx.google.com> (raw)
In-Reply-To: <20260309075946.28119-1-wegao@suse.com>

Hi!

> +	/* Wait for asynchronous kworker threads to dispatch events */
> +	usleep(100000);
> +
>  	read_len = SAFE_READ(0, fd_notify, event_buf, BUF_SIZE);
> +	read_len = consolidate_events(event_buf, read_len);

This doesn't sound correct. Instead of usleep() and "guessing" if data
is coming or not, we should poll() over the fd_notify and collect data
until BUF_SIZE. If data doesn't arrive, it means events were not
dispatched and test fails.

Remember that (in general) sleep operations hide test faults or bugs, as
it's explained in the ground rules guide:

https://linux-test-project.readthedocs.io/en/latest/developers/ground_rules.html#why-is-sleep-in-tests-bad-then

Kind regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

  reply	other threads:[~2026-03-09 10:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 13:38 [LTP] [PATCH v1] fanotify22.c: handle multiple asynchronous error events Wei Gao via ltp
2026-03-05  9:36 ` Jan Kara
2026-03-05 14:36   ` Wei Gao via ltp
2026-03-05 15:50     ` Jan Kara
2026-03-06  4:50       ` Wei Gao via ltp
2026-03-06 12:24         ` Petr Vorel
2026-03-06 15:19         ` Jan Kara
2026-03-09  7:59 ` [LTP] [PATCH v2] " Wei Gao via ltp
2026-03-09 10:26   ` Andrea Cervesato via ltp [this message]
2026-03-09 11:29   ` Jan Kara
2026-03-18  6:46   ` [LTP] [PATCH v3] " Wei Gao via ltp
2026-03-18 18:18     ` Jan Kara
2026-03-24 11:55     ` Andrea Cervesato via ltp
2026-03-25 12:43     ` [LTP] [PATCH v4] " Wei Gao via ltp
2026-03-25 15:52       ` Jan Kara
2026-03-26  1:28       ` [LTP] [PATCH v5] " Wei Gao via ltp
2026-03-26  8:57         ` Jan Kara
2026-03-26  9:40         ` Andrea Cervesato via ltp
2026-03-27  4:55         ` [LTP] [PATCH v6] " Wei Gao via ltp
2026-03-27  9:07           ` Andrea Cervesato via ltp
2026-03-27 12:33           ` [LTP] [PATCH v7] " Wei Gao via ltp
2026-03-27 14:19             ` Andrea Cervesato via ltp
2026-03-28  0:44               ` Wei Gao via ltp
2026-03-30  7:17                 ` Andrea Cervesato via ltp
2026-03-30  7:36                 ` Jan Kara

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=69aea049.050a0220.6a40f.4138@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=jack@suse.cz \
    --cc=oliver.sang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox