Skip to contentSkip to conversation

270: wait for fsstress processes to be killed

PATCH New Lukas Czerner 1 participant 1 message Jun 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 270: wait for fsstress processes to be killed

Currently wait will do nothing, because $pid is empty due to the fact that the command was ran on the background in a separate shell so we never got the $! set.

This is causing unexpected test failures especially under low memory due to the fact that the fsstress is still running when we are checking and comparing quota usage.

Fix it by using -w argument for killall that will wait for all processes to actually die before it exits.

---
 tests/generic/270 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/generic/270 +1 -3
index 5092ffa4..55779f5e 100755
@@ -38,7 +38,6 @@ _workout()
 	$SETCAP_PROG cap_chown=epi  $tmp.fsstress.bin
 
 	(su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1
-	pid=$!
 
 	echo "Run dd writers in parallel"
 	for ((i=0; i < num_iterations; i++))
@@ -50,8 +49,7 @@ _workout()
 		sleep $enospc_time
 	done
 
-	$KILLALL_PROG $tmp.fsstress.bin
-	wait $pid
+	$KILLALL_PROG -w $tmp.fsstress.bin
 }
 
 # real QA test starts here
Signature · 1 line
2.21.3