Skip to content

Commit b0944e0

Browse files
committed
Merge branch 'development' of https://git01.codeplex.com/casablanca into save_space
Conflicts: Release/tests/functional/websockets/client/authentication_tests.cpp
2 parents 57c01d6 + 7356763 commit b0944e0

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

Release/tests/functional/websockets/client/authentication_tests.cpp

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,41 @@ TEST_FIXTURE(uri_address, auth_with_credentials, "Ignore", "245")
8989
TEST(ssl_test)
9090
{
9191
websocket_client client;
92-
client.connect(U("wss://echo.websocket.org/")).wait();
9392
std::string body_str("hello");
9493

95-
auto receive_task = client.receive().then([body_str](websocket_incoming_message ret_msg)
94+
try
9695
{
97-
VERIFY_ARE_EQUAL(ret_msg.length(), body_str.length());
98-
auto ret_str = ret_msg.extract_string().get();
96+
client.connect(U("wss://echo.websocket.org/")).wait();
97+
auto receive_task = client.receive().then([body_str](websocket_incoming_message ret_msg)
98+
{
99+
VERIFY_ARE_EQUAL(ret_msg.length(), body_str.length());
100+
auto ret_str = ret_msg.extract_string().get();
99101

100-
VERIFY_ARE_EQUAL(body_str.compare(ret_str), 0);
101-
VERIFY_ARE_EQUAL(ret_msg.message_type(), websocket_message_type::text_message);
102-
});
102+
VERIFY_ARE_EQUAL(body_str.compare(ret_str), 0);
103+
VERIFY_ARE_EQUAL(ret_msg.message_type(), websocket_message_type::text_message);
104+
});
103105

104-
websocket_outgoing_message msg;
105-
msg.set_utf8_message(body_str);
106-
client.send(msg).wait();
106+
websocket_outgoing_message msg;
107+
msg.set_utf8_message(body_str);
108+
client.send(msg).wait();
107109

108-
receive_task.wait();
109-
client.close().wait();
110+
receive_task.wait();
111+
client.close().wait();
112+
}
113+
catch (const websocket_exception &e)
114+
{
115+
const auto msg = std::string(e.what());
116+
if (msg.find("set_fail_handler") != std::string::npos)
117+
{
118+
if (msg.find("TLS handshake timed out") != std::string::npos || msg.find("Timer Expired") != std::string::npos)
119+
{
120+
// Since this test depends on an outside server sometimes it sporadically can fail due to timeouts
121+
// especially on our build machines.
122+
return;
123+
}
124+
}
125+
throw;
126+
}
110127
}
111128

112129
// These tests are specific to our websocketpp based implementation.

0 commit comments

Comments
 (0)