Skip to content

Commit 49de3d2

Browse files
committed
ctest: mac: improve fixture startup delay
Co-developed-by: Gemini 2.5 Pro
1 parent 57142f9 commit 49de3d2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

scripts/ctest-background.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@ if [ -z "${SAI_LIST_PORT}" ] ; then
2424
sleep 1
2525
fi
2626
else
27-
if [ "${VENDOR}" = "apple" ] ; then
28-
while [ -z "`netstat -an | grep LISTEN | tr -s ' ' | cut -d' ' -f4| grep "\.${SAI_LIST_PORT}\$"`" ] ; do
29-
sleep 0.5
30-
done
31-
else
32-
while [ -z "`netstat -ltn4 | grep LISTEN | tr -s ' ' | grep ":${SAI_LIST_PORT}\ "`" ] ; do
33-
sleep 0.5
34-
done
35-
fi
27+
if [ "${VENDOR}" = "apple" ] ; then
28+
while [ -z "`lsof -iTCP -sTCP:LISTEN -P -n | grep -- ':${SAI_LIST_PORT}'`" ] ; do
29+
sleep 0.5
30+
done
31+
sleep 2
32+
else
33+
while [ -z "`netstat -ltn4 | grep LISTEN | tr -s ' ' | grep ":${SAI_LIST_PORT}\ "`" ] ; do
34+
sleep 0.5
35+
done
36+
fi
3637

3738
sleep 1
3839
fi

0 commit comments

Comments
 (0)