Report connection timeout as separate event (#1171)

This commit is contained in:
Gregor Jasny authored and GitHub committed 2022-01-26 17:32:40 -05:00
1 parent e5cacb465d
commit 87e03dd1ce
2 files changed
+33 -12

No files matched your search

+6 -1
View File
@@ -622,9 +622,14 @@ TEST(ConnectionErrorTest, Timeout) {
#endif
cli.set_connection_timeout(std::chrono::seconds(2));
// only probe one address type so that the error reason
// correlates to the timed-out IPv4, not the unsupported
// IPv6 connection attempt
cli.set_address_family(AF_INET);
auto res = cli.Get("/");
ASSERT_TRUE(!res);
EXPECT_TRUE(res.error() == Error::Connection);
EXPECT_EQ(Error::ConnectionTimeout, res.error());
}
TEST(CancelTest, NoCancel_Online) {