From cc39f37de6d652223b57be80495dd338babde589 Mon Sep 17 00:00:00 2001 From: Alyssa Wilk Date: Tue, 4 Sep 2018 10:43:57 -0400 Subject: [PATCH] Fixing the fix Signed-off-by: Alyssa Wilk --- source/common/network/connection_impl.cc | 2 +- test/integration/echo_integration_test.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/common/network/connection_impl.cc b/source/common/network/connection_impl.cc index 2326daeb054f..24652ab46039 100644 --- a/source/common/network/connection_impl.cc +++ b/source/common/network/connection_impl.cc @@ -68,7 +68,7 @@ ConnectionImpl::ConnectionImpl(Event::Dispatcher& dispatcher, ConnectionSocketPt } ConnectionImpl::~ConnectionImpl() { - ASSERT(fd() == -1); + ASSERT(fd() == -1, "ConnectionImpl was unexpectedly torn down without being closed."); // In general we assume that owning code has called close() previously to the destructor being // run. This generally must be done so that callbacks run in the correct context (vs. deferred diff --git a/test/integration/echo_integration_test.cc b/test/integration/echo_integration_test.cc index 12445e7b51a0..1eef8fb6a0eb 100644 --- a/test/integration/echo_integration_test.cc +++ b/test/integration/echo_integration_test.cc @@ -134,6 +134,8 @@ TEST_P(EchoIntegrationTest, AddRemoveListener) { if (connection2.connection().state() == Network::Connection::State::Closed) { connect_fail = true; break; + } else { + connection2.close(); } } ASSERT_TRUE(connect_fail);