1
0
mirror of synced 2025-06-12 07:41:53 +03:00

Report connection timeout as separate event (#1171)

This commit is contained in:
Gregor Jasny
2022-01-26 23:32:40 +01:00
committed by GitHub
parent e5cacb465d
commit 87e03dd1ce
2 changed files with 33 additions and 12 deletions

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) {