From: vincentfu@gmail.com
To: axboe@kernel.dk, fio@vger.kernel.org
Cc: Vincent Fu <vincent.fu@wdc.com>
Subject: [PATCH 3/3] t/run-fio-tests: improve error handling
Date: Mon, 11 Nov 2019 11:30:55 -0500 [thread overview]
Message-ID: <20191111163055.7358-4-vincentfu@gmail.com> (raw)
In-Reply-To: <20191111163055.7358-1-vincentfu@gmail.com>
From: Vincent Fu <vincent.fu@wdc.com>
More gracefully handle errors when running a test. Also change the
EXAMPLE to refer to fio's canonical git repository.
---
t/run-fio-tests.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/t/run-fio-tests.py b/t/run-fio-tests.py
index 1b8ca0a2..cf8de093 100755
--- a/t/run-fio-tests.py
+++ b/t/run-fio-tests.py
@@ -14,7 +14,7 @@
#
#
# EXAMPLE
-# # git clone [fio-repository]
+# # git clone git://git.kernel.dk/fio.git
# # cd fio
# # make -j
# # python3 t/run-fio-tests.py
@@ -123,6 +123,7 @@ class FioExeTest(FioTest):
stderr_file = open(self.stderr_file, "w+")
exticode_file = open(self.exticode_file, "w+")
try:
+ proc = None
# Avoid using subprocess.run() here because when a timeout occurs,
# fio will be stopped with SIGKILL. This does not give fio a
# chance to clean up and means that child processes may continue
@@ -142,9 +143,10 @@ class FioExeTest(FioTest):
assert proc.poll()
self.output['failure'] = 'timeout'
except Exception:
- if not proc.poll():
- proc.terminate()
- proc.communicate()
+ if proc:
+ if not proc.poll():
+ proc.terminate()
+ proc.communicate()
self.output['failure'] = 'exception'
self.output['exc_info'] = sys.exc_info()
finally:
--
2.17.1
next prev parent reply other threads:[~2019-11-11 16:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 16:30 [PATCH 0/3] three patches vincentfu
2019-11-11 16:30 ` [PATCH 1/3] filesetup: improve LFSR init failure error message vincentfu
2019-11-11 16:30 ` [PATCH 2/3] io_u: move to next zone even if zoneskip is unset vincentfu
2019-11-11 16:30 ` vincentfu [this message]
2019-11-14 21:07 ` [PATCH 0/3] three patches Jens Axboe
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=20191111163055.7358-4-vincentfu@gmail.com \
--to=vincentfu@gmail.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=vincent.fu@wdc.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