From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Schofield, Alison" <alison.schofield@intel.com>
Cc: "linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
"nvdimm@lists.linux.dev" <nvdimm@lists.linux.dev>
Subject: Re: [ndctl PATCH 3/3] cxl/test: use an explicit --since time in journalctl
Date: Tue, 28 Nov 2023 22:18:17 +0000 [thread overview]
Message-ID: <d61419797cf1b04540cddf2508f1e6869a702998.camel@intel.com> (raw)
In-Reply-To: <1802cf15f22fe5c284167a9186eba8f2cd3c31c6.1701143039.git.alison.schofield@intel.com>
On Mon, 2023-11-27 at 20:11 -0800, alison.schofield@intel.com wrote:
> From: Alison Schofield <alison.schofield@intel.com>
>
> Using the bash variable 'SECONDS' plus 1 for searching the
> dmesg log sometimes led to one test picking up error messages
> from the previous test when run as a suite. SECONDS alone may
> miss some logs, but SECONDS + 1 is just as often too great.
>
> Since unit tests in the CXL suite are using common helpers to
> start and stop work, initialize and use a "starttime" variable
> with millisecond granularity for journalctl.
>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> ---
> test/common | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/test/common b/test/common
> index c20b7e48c2b6..93a280c7c150 100644
> --- a/test/common
> +++ b/test/common
> @@ -156,7 +156,7 @@ check_dmesg()
> cxl_check_dmesg()
> {
> sleep 1
> - log=$(journalctl -r -k --since "-$((SECONDS+1))s")
> + log=$(journalctl -r -k --since "$starttime")
Once this is moved to the geenric helper, the other check_dmesg() will
get this benefit too, not just the cxl version :)
It might be worth adding a check to see if $starttime has been set, and
erroring out if not, in case a future test tries to use this, but
doesn't realize that they should've also used the common start helper.
> # validate no WARN or lockdep report during the run
> grep -q "Call Trace" <<< "$log" && err "$1"
> # validate no failures of the interleave calc dev_dbg() check
> @@ -175,6 +175,7 @@ cxl_common_start()
> check_prereq "dd"
> check_prereq "sha256sum"
> modprobe -r cxl_test
> + starttime=$(date +"%T.%3N")
> modprobe cxl_test "$1"
> rc=1
> }
prev parent reply other threads:[~2023-11-28 22:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 4:11 [ndctl PATCH 0/3] cxl/test: CXL unit test helpers alison.schofield
2023-11-28 4:11 ` [ndctl PATCH 1/3] cxl/test: add and use cxl_common_[start|stop] helpers alison.schofield
2023-11-28 18:14 ` Dave Jiang
2023-11-28 21:50 ` Verma, Vishal L
2023-11-28 4:11 ` [ndctl PATCH 2/3] cxl/test: add a cxl_ derivative of check_dmesg() alison.schofield
2023-11-28 18:18 ` Dave Jiang
2023-11-28 22:11 ` Verma, Vishal L
2023-11-28 4:11 ` [ndctl PATCH 3/3] cxl/test: use an explicit --since time in journalctl alison.schofield
2023-11-28 18:19 ` Dave Jiang
2023-11-28 22:18 ` Verma, Vishal L [this message]
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=d61419797cf1b04540cddf2508f1e6869a702998.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=alison.schofield@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
/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