Skip to content

Commit 721f91f

Browse files
committed
ctest: mac: improve fixture startup delay
Co-developed-by: Gemini 2.5 Pro
1 parent 51a2839 commit 721f91f

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

scripts/ctest-background.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ 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+
else
32+
while [ -z "`netstat -ltn4 | grep LISTEN | tr -s ' ' | grep ":${SAI_LIST_PORT}\ "`" ] ; do
33+
sleep 0.5
34+
done
35+
fi
3636

3737
sleep 1
3838
fi

0 commit comments

Comments
 (0)