Commit 9ca584be authored by Amir Livneh's avatar Amir Livneh Committed by Facebook GitHub Bot

Assert AsyncSocketException message in WritePipeError test

Differential Revision: D24757714

fbshipit-source-id: 1a494c5eb758480431d5aa70861359e67e9f831c
parent d0430b3e
......@@ -46,6 +46,7 @@ using std::string;
using std::unique_ptr;
using std::vector;
using std::chrono::milliseconds;
using testing::MatchesRegex;
using namespace folly;
using namespace folly::test;
......@@ -1097,7 +1098,11 @@ TEST(AsyncSocketTest, WritePipeError) {
// so that we could check for EPIPE
ASSERT_EQ(wcb.state, STATE_FAILED);
ASSERT_EQ(wcb.exception.getType(), AsyncSocketException::INTERNAL_ERROR);
ASSERT_THAT(
wcb.exception.what(),
MatchesRegex(
"AsyncSocketException: writev\\(\\) failed \\(peer=.+, local=.+\\), "
"type = Internal error, errno = .+ \\(Broken pipe\\)"));
ASSERT_FALSE(socket->isClosedBySelf());
ASSERT_FALSE(socket->isClosedByPeer());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment