]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
check: ensure sect_stop is initialized if interrupted
authorDavid Disseldorp <ddiss@suse.de>
Mon, 12 Dec 2022 23:08:20 +0000 (00:08 +0100)
committerZorro Lang <zlang@kernel.org>
Wed, 14 Dec 2022 18:03:18 +0000 (02:03 +0800)
commit210af953f70974ec794b40f7f8769c5637df77da
tree36c8eefe13be419dec7b111f852c43aa78ed70f9
parenta8a3cd342f9054184bb9faf07fb9b87df112b8b2
check: ensure sect_stop is initialized if interrupted

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>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
check