Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions test/integration/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ void IntegrationTestServer::start(const Network::Address::IpVersion version,
IntegrationTestServer::~IntegrationTestServer() {
ENVOY_LOG(info, "stopping integration test server");

BufferingStreamDecoderPtr response =
IntegrationUtil::makeSingleRequest(server_->admin().socket().localAddress(), "POST",
"/quitquitquit", "", Http::CodecClient::Type::HTTP1);
EXPECT_TRUE(response->complete());
EXPECT_STREQ("200", response->headers().Status()->value().c_str());
if (admin_address_ != nullptr) {
BufferingStreamDecoderPtr response = IntegrationUtil::makeSingleRequest(
admin_address_, "POST", "/quitquitquit", "", Http::CodecClient::Type::HTTP1);
EXPECT_TRUE(response->complete());
EXPECT_STREQ("200", response->headers().Status()->value().c_str());
}

thread_->join();
}
Expand Down Expand Up @@ -107,6 +108,10 @@ void IntegrationTestServer::threadRoutine(const Network::Address::IpVersion vers
restarter, stats_store, lock, *this, std::move(random_generator), tls));
pending_listeners_ = server_->listenerManager().listeners().size();
ENVOY_LOG(info, "waiting for {} test server listeners", pending_listeners_);
// This is technically thread unsafe (assigning to a shared_ptr accessed
// across threads), but because we synchronize below on server_set, the only
// consumer on the main test thread in ~IntegrationTestServer will not race.
admin_address_ = server_->admin().socket().localAddress();
server_set_.setReady();
server_->run();
server_.reset();
Expand Down
1 change: 1 addition & 0 deletions test/integration/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ class IntegrationTestServer : Logger::Loggable<Logger::Id::testing>,
Stats::Store* stat_store_{};
std::function<void()> on_worker_listener_added_cb_;
std::function<void()> on_worker_listener_removed_cb_;
Network::Address::InstanceConstSharedPtr admin_address_;
};

} // namespace Envoy