Thread (19 messages) 19 messages, 3 authors, 2021-07-18
STALE1831d

[PATCH 6/8] xfs/084: fix test program status collection and processing

From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-07-07 00:21:41
Also in: fstests
Subsystem: the rest · Maintainer: Linus Torvalds

From: Darrick J. Wong <djwong@kernel.org>

On a test VM with 1.2GB memory, I noticed that the test will sometimes
fail because resvtest leaks too much memory and gets OOM killed.  It
would be useful to _notrun the test when this happens so that it doesn't
appear as an intermittent regression.

The exit code processing in this test is incorrect, since "$?" will get
us the exit status of _filter_resv, not $here/src/resvtest.  Fix that
as part of learning to detect a SIGKILL and skip the test.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/084 |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/xfs/084 b/tests/xfs/084
index 5967fe12..e796fec4 100755
--- a/tests/xfs/084
+++ b/tests/xfs/084
@@ -33,13 +33,17 @@ _require_test
 echo
 echo "*** First case - I/O blocksize same as pagesize"
 $here/src/resvtest -i 20 -b $pgsize "$TEST_DIR/resv" | _filter_resv
-[ $? -eq 0 ] && echo done
+res=${PIPESTATUS[0]}
+[ $res -eq 137 ] && _notrun "resvtest -i 20 -b $pgsize was SIGKILLed (OOM?)"
+[ $res -eq 0 ] && echo done
 rm -f "$TEST_DIR/mumble"
 
 echo
 echo "*** Second case - 512 byte I/O blocksize"
 $here/src/resvtest -i 40 -b 512 "$TEST_DIR/resv" | _filter_resv
-[ $? -eq 0 ] && echo done
+res=${PIPESTATUS[0]}
+[ $res -eq 137 ] && _notrun "resvtest -i 40 -b 512 was SIGKILLed (OOM?)"
+[ $res -eq 0 ] && echo done
 rm -f "$TEST_DIR/grumble"
 
 # success, all done
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help