-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
unit_tests.sh fails in last check with timeouted server connection #791
Comments
Regression was introduced in 6ae4a76 // Invalid in TCP or RTU mode...
modbus_t *invalid_ctx = modbus_new_tcp("1.2.3.4", 1502);
modbus_set_response_timeout(ctx, 0, 1); // <-- BUG: should be invalid_ctx, right?
rc = modbus_connect(invalid_ctx);
printf("8/8 Connection timeout: ");
ASSERT_TRUE(rc == -1 && errno == ETIMEDOUT, "");
modbus_free(invalid_ctx); When adjusting the response timeout in ctx rather the intendet invalid_ctx the connection fails with errno 111 (connection refused). I'm not quite clear why this happens, as we try to use invalid_ctx in the connect statement and not ctx. The errno is set to ETIMEDOUT in modbus-tcp.c:310 correctly, when using the timeout on By changing ctx to invalid_ctx in the test code (see snipped above) the test suite runs correctly again. -> pull request |
…nvalid_ctx (closes stephane#791)
…nvalid_ctx (closes stephane#791)
Running
unit_tests.sh
gives an assert in theunit-test-client.log
:This causes the test suite to fail.
The text was updated successfully, but these errors were encountered: