Linux DTrace development list
 help / color / mirror / Atom feed
* [PATCH] test: Wait for output to flush out in enable_pid
@ 2025-06-08  5:36 eugene.loh
  2025-06-13 14:15 ` Nick Alcock
  0 siblings, 1 reply; 2+ messages in thread
From: eugene.loh @ 2025-06-08  5:36 UTC (permalink / raw)
  To: dtrace, dtrace-devel

From: Eugene Loh <eugene.loh@oracle.com>

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.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
 test/unittest/usdt/tst.enable_pid.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/unittest/usdt/tst.enable_pid.sh b/test/unittest/usdt/tst.enable_pid.sh
index 7f4f68698..5a151c767 100755
--- a/test/unittest/usdt/tst.enable_pid.sh
+++ b/test/unittest/usdt/tst.enable_pid.sh
@@ -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
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] test: Wait for output to flush out in enable_pid
  2025-06-08  5:36 [PATCH] test: Wait for output to flush out in enable_pid eugene.loh
@ 2025-06-13 14:15 ` Nick Alcock
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Alcock @ 2025-06-13 14:15 UTC (permalink / raw)
  To: eugene.loh; +Cc: dtrace, dtrace-devel

On 8 Jun 2025, eugene loh told this:

> From: Eugene Loh <eugene.loh@oracle.com>
>
> 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.

-- 
NULL && (void)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-13 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08  5:36 [PATCH] test: Wait for output to flush out in enable_pid eugene.loh
2025-06-13 14:15 ` Nick Alcock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox