public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: fstests@vger.kernel.org
Cc: David Disseldorp <ddiss@suse.de>
Subject: [PATCH 3/3] check: ensure sect_stop is initialized if interrupted
Date: Tue, 13 Dec 2022 00:08:20 +0100	[thread overview]
Message-ID: <20221212230820.3466-3-ddiss@suse.de> (raw)
In-Reply-To: <20221212230820.3466-1-ddiss@suse.de>

sect_stop is normally set immediately prior to calling _wrapup() via
run_section(). However, when called via a trap signal handler,
sect_stop may be uninitialized, leading to a negative section time
(sect_stop - sect_start) in the xunit report. E.g.
  Interrupted!
  Passed all 1 tests
  Xunit report: /home/david/xfstests/results//result.xml
  rapido1:/# head /home/david/xfstests/results//result.xml
  <?xml version="1.0" encoding="UTF-8"?>
  <testsuite name="xfstests" failures="0" skipped="0" tests="1"
   time="-1670885797" ... >

This commit uses the existing $interrupt flag to determine when
sect_stop needs to be initialised.

Signed-off-by: David Disseldorp <ddiss@suse.de>
---
 check | 1 +
 1 file changed, 1 insertion(+)

diff --git a/check b/check
index d2e51296..cb3ea155 100755
--- a/check
+++ b/check
@@ -433,6 +433,7 @@ _wrapup()
 {
 	seq="check"
 	check="$RESULT_BASE/check"
+	$interrupt && sect_stop=`_wallclock`
 
 	if $showme && $needwrap; then
 		if $do_report; then
-- 
2.35.3


  parent reply	other threads:[~2022-12-12 23:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 23:08 [PATCH 1/3] common/attr: require xfs_spaceman for xfs acl_get_max David Disseldorp
2022-12-12 23:08 ` [PATCH 2/3] tests/generic/027: use c-style for loops David Disseldorp
2022-12-13  5:51   ` Eric Biggers
2022-12-13  8:56     ` David Disseldorp
2022-12-12 23:08 ` David Disseldorp [this message]
2022-12-13 14:51   ` [PATCH 3/3] check: ensure sect_stop is initialized if interrupted Zorro Lang
2022-12-13 14:41 ` [PATCH 1/3] common/attr: require xfs_spaceman for xfs acl_get_max Zorro Lang
2022-12-13 15:32   ` David Disseldorp
2022-12-13 18:25     ` Zorro Lang
2022-12-13 19:08       ` David Disseldorp
2022-12-13 19:27         ` Darrick J. Wong
2022-12-13 19:58           ` Zorro Lang

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=20221212230820.3466-3-ddiss@suse.de \
    --to=ddiss@suse.de \
    --cc=fstests@vger.kernel.org \
    /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