Skip to content

Commit 4edd844

Browse files
committed
fix(ci): start IoTDB on Windows with cmd //c and wait for RPC port 6667
Git Bash mangles cmd.exe /c so start-standalone.bat never ran; use //c with quoted paths and poll Test-NetConnection before running packaged examples.
1 parent 17a26a1 commit 4edd844

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/workflows/client-cpp-package.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,26 @@ jobs:
489489
fi
490490
SERVER_ROOT=$(find "${WORKSPACE_BASE}/distribution/target" -path '*/apache-iotdb-*-all-bin/sbin/windows/start-standalone.bat' -print -quit | sed 's#/sbin/windows/start-standalone.bat##')
491491
test -n "${SERVER_ROOT}"
492-
cmd.exe /c "$(cygpath -w "${SERVER_ROOT}/sbin/windows/start-standalone.bat")"
493-
trap 'cmd.exe /c "$(cygpath -w "${SERVER_ROOT}/sbin/windows/stop-standalone.bat")" || true' EXIT
494-
sleep 30
492+
START_BAT="$(cygpath -w "${SERVER_ROOT}/sbin/windows/start-standalone.bat")"
493+
STOP_BAT="$(cygpath -w "${SERVER_ROOT}/sbin/windows/stop-standalone.bat")"
494+
cmd.exe //c "\"${START_BAT}\""
495+
trap "cmd.exe //c '\"${STOP_BAT}\"' || true" EXIT
496+
echo "Waiting for IoTDB RPC on 127.0.0.1:6667..."
497+
ready=0
498+
for _ in $(seq 1 60); do
499+
if powershell.exe -NoProfile -Command \
500+
'(Test-NetConnection -ComputerName 127.0.0.1 -Port 6667 -WarningAction SilentlyContinue).TcpTestSucceeded' \
501+
| grep -qi True; then
502+
ready=1
503+
break
504+
fi
505+
sleep 2
506+
done
507+
if [ "${ready}" -ne 1 ]; then
508+
echo "ERROR: IoTDB did not listen on 6667 within 120s"
509+
ls -la "${SERVER_ROOT}/logs" 2>/dev/null || true
510+
exit 1
511+
fi
495512
for exe in SessionExample.exe AlignedTimeseriesSessionExample.exe TableModelSessionExample.exe tree_example.exe table_example.exe; do
496513
EXE=$(find "${EXAMPLE_BUILD}" -name "${exe}" -print -quit)
497514
test -n "${EXE}"

0 commit comments

Comments
 (0)