Skip to content

CDRIVER-4656 check if server is running with TLS in tests #1702

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

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Aug 12, 2024

Followup to #1673. Fixes failing retry-true-latest-server task. Example failure:

FAIL:tests/test-mongoc-client.c:2240  test_mongoc_client_change_openssl_ctx_before_ops()
  ret
  No suitable servers found: `serverSelectionTimeoutMS` expired: [TLS handshake failed: Connection timed out calling hello on 'localhost:27017']. Topology type: Single

Tests require the server to be running with TLS enabled. The retry-true-latest-server uses a C driver built with OpenSSL, but does not run against a server with TLS enabled.

Verified with this patch.

@kevinAlbs kevinAlbs force-pushed the fix-test.CDRIVER-4656 branch from cefb1ba to f94a316 Compare August 12, 2024 20:27
@kevinAlbs kevinAlbs marked this pull request as ready for review August 12, 2024 20:27
Copy link
Contributor

@vector-of-bool vector-of-bool left a comment

Choose a reason for hiding this comment

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

LGTM, minor note

@@ -2224,6 +2224,12 @@ test_client_buildinfo_hang (void)
static void
test_mongoc_client_change_openssl_ctx_before_ops (void)
{
if (!test_framework_get_ssl ()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add @ctest-skipped@@ somewhere in message, which CTest will scan for and consider the test skipped if it sees it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to use a skip function in TestSuite_AddFull. This results in printing @@ctest-skipped@@ on skip.

And skip test using skip function in `TestSuite_AddFull`. Tells CTest that the test was skipped.
@kevinAlbs kevinAlbs merged commit fc243b9 into mongodb:master Aug 16, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants