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
3 changes: 2 additions & 1 deletion source/common/config/filesystem_subscription_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void FilesystemSubscriptionImpl::refresh() {
ENVOY_LOG(debug, "Filesystem config refresh for {}", path_);
stats_.update_attempt_.inc();
bool config_update_available = false;
envoy::api::v2::DiscoveryResponse message;
try {
envoy::api::v2::DiscoveryResponse message;
MessageUtil::loadFromFile(path_, message, api_);
config_update_available = true;
callbacks_->onConfigUpdate(message.resources(), message.version_info());
Expand All @@ -53,6 +53,7 @@ void FilesystemSubscriptionImpl::refresh() {
} catch (const EnvoyException& e) {
if (config_update_available) {
ENVOY_LOG(warn, "Filesystem config update rejected: {}", e.what());
ENVOY_LOG(debug, "Failed configuration:\n{}", message.DebugString());
stats_.update_rejected_.inc();
} else {
ENVOY_LOG(warn, "Filesystem config update failure: {}", e.what());
Expand Down
16 changes: 15 additions & 1 deletion test/integration/integration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,23 @@ void BaseIntegrationTest::createGeneratedApiTestServer(const std::string& bootst
defer_listener_finalization_);
if (config_helper_.bootstrap().static_resources().listeners_size() > 0 &&
!defer_listener_finalization_) {

// Wait for listeners to be created before invoking registerTestServerPorts() below, as that
// needs to know about the bound listener ports.
test_server_->waitForCounterGe("listener_manager.listener_create_success", 1);
auto end_time = time_system_.monotonicTime() + TestUtility::DefaultTimeout;
const char* success = "listener_manager.listener_create_success";
const char* failure = "listener_manager.lds.update_rejected";
while (test_server_->counter(success) == nullptr ||
test_server_->counter(success)->value() == 0) {
if (time_system_.monotonicTime() >= end_time) {
RELEASE_ASSERT(0, "Timed out waiting for listeners.");
}
RELEASE_ASSERT(test_server_->counter(failure) == nullptr ||
test_server_->counter(failure)->value() == 0,
"Lds update failed");
time_system_.sleep(std::chrono::milliseconds(10));
}

registerTestServerPorts(port_names);
}
}
Expand Down