You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_REUSEADDRis described as an advanced option and only for tests.
Shall open62541 built with reuseaddr not be used in production (i.e. packaged and distributed)?
Would you recommend to just ignore/exclude the affected tests? Or should there be a full package build cycle with enabled unit tests and reuseaddr of which the result is thrown away? The packaged and distributed library would not be the one that was tested.
What about the open62541 project to enable these tests only if the project is configured with reuseaddr? This would allow as many tests as permitted by the configuration to run and you can continue using test-only builds with additional options in your CI.
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):
You always want to have UA_ENABLE_ALLOW_REUSEADDR=TRUE for the unit tests.
Otherwise the operating systems needs a minute to release the socket after the last use.
Due to the TCP timeout.
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.
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: