Skip to content

🍎 tests: release UDP port between MAVFTP tests#1219

Merged
peterbarker merged 1 commit into
ArduPilot:masterfrom
drnic:fix/mavftp-test-port-leak
Jun 22, 2026
Merged

🍎 tests: release UDP port between MAVFTP tests#1219
peterbarker merged 1 commit into
ArduPilot:masterfrom
drnic:fix/mavftp-test-port-leak

Conversation

@drnic

@drnic drnic commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

TestMAVFTPPayloadDecoding.setUp() opens a udp:localhost:14550 connection for every test, but tearDown() never closed it. Re-binding the same port in the next test's setUp() succeeds on Linux (the socket sets SO_REUSEADDR) but fails on macOS with OSError: [Errno 48] Address already in use, since macOS additionally requires SO_REUSEPORT to rebind.

This makes the test suite fail for anyone running it on macOS, while passing in CI (Linux).

TestMAVFTPPayloadDecoding.setUp() opens a udp:localhost:14550 connection
for every test but tearDown() never closed it. Re-binding the port in the
next setUp() works on Linux (SO_REUSEADDR) but fails on macOS with
'Address already in use'. Close the connection in tearDown().
@drnic drnic changed the title tests: release UDP port between MAVFTP tests 🍎 tests: release UDP port between MAVFTP tests Jun 22, 2026

@peterbarker peterbarker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@peterbarker peterbarker merged commit 22b3891 into ArduPilot:master Jun 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants