Skip to content

Commit df0eeb8

Browse files
authored
CDRIVER-4349 unskip /Client/get_handshake_hello_response/pooled and relax assertion. (#1436)
* check for `Unknown` or `PossiblePrimary` * unskip `/Client/get_handshake_hello_response/pooled`
1 parent b87d180 commit df0eeb8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.evergreen/etc/skip-tests.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
/change_stream/live/track_resume_token # (CDRIVER-4344) Condition 'bson_compare (resume_token, &doc2_rt) == 0' failed
2929
/ClientPool/pop_timeout # (CDRIVER-4348) precondition failed: duration_usec / 1000 >= 1990
30-
/Client/get_handshake_hello_response/pooled # (CDRIVER-4349) Assert Failure: "Unknown" != "PossiblePrimary"
3130

3231
/change_streams/legacy/change-streams # (CDRIVER-4350) Could not establish stream for node 127.0.0.1:8000: [TLS handshake failed: Connection timed out calling hello on '127.0.0.1:8000']
3332
/change_streams/legacy/change-streams-resume-allowlist # (CDRIVER-4350) Could not establish stream for node 127.0.0.1:8000: [TLS handshake failed: Connection timed out calling hello on '127.0.0.1:8000']

src/libmongoc/tests/test-mongoc-client.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4089,7 +4089,18 @@ test_mongoc_client_get_handshake_hello_response_pooled (void)
40894089
invalidated_sd =
40904090
mongoc_client_get_server_description (client, monitor_sd->id);
40914091
BSON_ASSERT (NULL != invalidated_sd);
4092-
ASSERT_CMPSTR ("Unknown", mongoc_server_description_type (invalidated_sd));
4092+
4093+
// Check the resulting server description.
4094+
// Invalidating sets the type to Unknown.
4095+
// A background monitor may have set the type to PossiblePrimary.
4096+
const char *got_description_type =
4097+
mongoc_server_description_type (invalidated_sd);
4098+
if (0 != strcmp ("Unknown", got_description_type) &&
4099+
0 != strcmp ("PossiblePrimary", got_description_type)) {
4100+
test_error ("Expected server to have type 'Unknown' or "
4101+
"'PossiblePrimary', got: '%s'",
4102+
got_description_type);
4103+
}
40934104

40944105
/* The previously established connection should have a valid server
40954106
* description. */

0 commit comments

Comments
 (0)