Skip to content

Commit b32d66f

Browse files
committed
Fix CI integration test failures
Two breakages in the integration test steps: 1. `pip install -U pymodbus` pulls pymodbus 3.x, which removed `pymodbus.server.sync` and `ModbusBinaryFramer`. server.py crashes on import, leaving the modbus client step to time out against a port nothing is listening on. Pin to pymodbus<3 so the existing server.py still imports, and pin Python to 3.11 since pymodbus 2.5.3 has not been validated against newer interpreters. 2. Servers are backgrounded with `&` and the next step runs the client immediately, racing the listen socket. Add explicit wait-for-port steps using bash's /dev/tcp before each client runs, and capture server output to /tmp logs so a failure surfaces diagnostics instead of just timing out. Also `nohup` the backgrounded servers and redirect their output so they survive the step boundary cleanly without printing into the runner log mid-step.
1 parent ef62758 commit b32d66f

1 file changed

Lines changed: 31 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,45 @@ jobs:
3030
./setup_posix.sh
3131
make
3232
sudo setcap cap_net_raw+ep ./src/ports/POSIX/OpENer
33-
./src/ports/POSIX/OpENer lo &
33+
nohup ./src/ports/POSIX/OpENer lo > /tmp/opener.log 2>&1 &
34+
35+
- name: Wait for OpENer to listen on 44818
36+
run: |
37+
for i in {1..30}; do
38+
if (exec 3<>/dev/tcp/127.0.0.1/44818) 2>/dev/null; then
39+
exec 3<&- 3>&-
40+
exit 0
41+
fi
42+
sleep 1
43+
done
44+
echo "OpENer did not start listening on 44818" >&2
45+
cat /tmp/opener.log >&2 || true
46+
exit 1
3447
3548
- working-directory: node-drivers
3649
run: node test/integration/eip.js
3750

3851
- uses: actions/setup-python@v5
3952
with:
40-
python-version: '3.x'
41-
53+
python-version: '3.11'
54+
4255
- working-directory: node-drivers
4356
run: |
44-
pip install -U pymodbus
45-
python ./test/integration/modbus/server.py &
57+
pip install 'pymodbus<3'
58+
nohup python -u ./test/integration/modbus/server.py > /tmp/modbus-server.log 2>&1 &
59+
60+
- name: Wait for modbus server to listen on 5020
61+
run: |
62+
for i in {1..30}; do
63+
if (exec 3<>/dev/tcp/127.0.0.1/5020) 2>/dev/null; then
64+
exec 3<&- 3>&-
65+
exit 0
66+
fi
67+
sleep 1
68+
done
69+
echo "Modbus server did not start listening on 5020" >&2
70+
cat /tmp/modbus-server.log >&2 || true
71+
exit 1
4672
4773
- working-directory: node-drivers
4874
run: node test/integration/modbus/client.js
49-
50-
51-
52-
53-

0 commit comments

Comments
 (0)