Skip to content

Fix flaky measure manager CLI tests racing for the same port - #5702

Open
anchapin wants to merge 1 commit into
developfrom
measure-manager-resource-lock
Open

anchapin wants to merge 1 commit into
developfrom
measure-manager-resource-lock

Conversation

@anchapin

Copy link
Copy Markdown
Collaborator

Closes #5701.

OpenStudioCLI.test_measure_manager and OpenStudioCLI.Classic.test_measure_manager each start a measure-manager server. get_open_port_for_serving() checks that a port is free, closes the socket, then launches the server, so when CTest runs both at once they can pick the same port and one test talks to the other's server. That's what failed Ubuntu 24.04 x64 in Full Build run 42922295432 on #5700 (port=8090 is already in use, then the other CLI's responses).

This adds a shared RESOURCE_LOCK so CTest never runs them at the same time, the same way src/cli/CMakeLists.txt already locks the compact_osw tests. The lock also applies when CTest re-runs failed tests.

Testing: checked in a scratch CMake project that ctest --show-only=json-v1 lists RESOURCE_LOCK measure_manager_port on both tests. CI on this PR runs both tests on every platform.

🤖 Generated with Claude Code

Both start a measure manager server after checking that a port is free,
so when CTest runs them in parallel they can pick the same port and one
test talks to the other's server.

Closes #5701
@anchapin anchapin added the Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. label Nov 11, 2026
@anchapin anchapin closed this Nov 11, 2026
@anchapin anchapin reopened this Nov 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Results Dashboard

Summary

Metric Value
Total Tests 4202
Passed 4202
Failed 0
Errors 0
Skipped 0
Success Rate 100.0%
Generated 2026-11-11 05:17:54 UTC

✅ All Tests Passed!

📊 Test Run Information

Run XML File Status
run1 results.xml ✅ Found
run2 results.xml ✅ Found

@ci-commercialbuildings

ci-commercialbuildings commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

CI Results for 61824e8:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: OpenStudioCLI.test_measure_manager and its Classic variant race for the same port

2 participants