-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guidance for unit testing without UA_ENABLE_ALLOW_REUSEADDR #6407
Comments
You always want to have UA_ENABLE_ALLOW_REUSEADDR=TRUE for the unit tests. In a productive server application it is recommended to have UA_ENABLE_ALLOW_REUSEADDR=FALSE. So that no other process can "steal the socket" of a running server. |
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I seek guidance for running unit tests as part of packaging open62541 in a GNU/Linux distro. It seems unit tests fail if the project is configured with
-DUA_BUILD_UNIT_TESTS=TRUE
and without also passing-DUA_ENABLE_ALLOW_REUSEADDR=TRUE
.Background Information / Reproduction Steps
I maintain the open62541 package in NixOS. The normal procedure for building a package is basically configure, build, check, install. I.e. building and running unit tests is considered normal and increases confidence that we don't ship a broken package. Since v1.4.0, several tests fail if the project is configured with
-DUA_BUILD_UNIT_TESTS=TRUE
and without-DUA_ENABLE_ALLOW_REUSEADDR=TRUE
. If reuseaddr is enabled, tests pass.UA_ENABLE_ALLOW_REUSEADDR
is described as an advanced option and only for tests.The affected failing unit tests without reuseaddr are (at least):
check_server_reverseconnect
check_client_subscriptions
check_subscriptionWithactivateSession
check_client_historical_data
(Also
check_eventloop_eth
fails because it requires elevated permissions to use raw sockets. This is irrelevant for this issue, but a suggestion could be to check the permissions at runtime and skip the test if they are insufficient.)Used CMake options (Nix package specific options stripped for brevity):
Checklist
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: