Skip to contentSkip to conversation

test: Wait for output to flush out in enable_pid

PATCH Superseded [email protected] 2 participants 2 messages Jun 8, 2025 – Jun 13, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: Wait for output to flush out in enable_pid

From: Eugene Loh <[email protected]>

Our luck with this test has been quite good, but it sometimes fails to show its last lines of output. That is, we send a USR1 to the trigger processes to set off the final output and we immediately cat the output files. If there is any delay, the last output will be missing.

Add a short delay so that the last output will be seen.

---
 test/unittest/usdt/tst.enable_pid.sh | 3 +++
 1 file changed, 3 insertions(+)
test/unittest/usdt/tst.enable_pid.sh +3 -0
index 7f4f68698..5a151c767 100755
@@ -172,6 +172,9 @@ for pid in 1 $pid1 $pid2 '*'; do
 	kill -USR1 $pid2
 done
 
+# wait for last of the output to flush out
+sleep 2
+
 echo done
 echo "========== out 1"; cat out.1
 echo "========== out 2"; cat out.2
Signature · 1 line
2.43.5
#1 lore raw

On 8 Jun 2025, eugene loh told this:

Quoted 9 lines

From: Eugene Loh <[email protected]>

Our luck with this test has been quite good, but it sometimes fails to show its last lines of output. That is, we send a USR1 to the trigger processes to set off the final output and we immediately cat the output files. If there is any delay, the last output will be missing.

Add a short delay so that the last output will be seen.

Unavoidable if it's structured this way, but if you hit them with a USR2 and caught USR2 and had that do the same output as USR1 and then exit(), and did a wait(1) for both of them, you could avoid this delay.

Signature · 1 line
NULL && (void)