Skip to content

Commit

Permalink
Update Envoy to 1f52a8e (Mar 29, 2024) (#1114)
Browse files Browse the repository at this point in the history
* Update Envoy to 1f52a8e (Mar 29, 2024)

- No changes to .bazelrc etc.
- Implemented `lifecycleNotifier()` on `NighthawkServerInstance` and `NighthawkServerFactoryContext` (H/T @eziskind for the advance warning and known-good fix)
- Implemented `regexEngine()` on `NighthawkServerFactoryContext`
- Reacted to envoyproxy/envoy#32775
  - Renamed `unpackTo` to `unpackToOrThrow`
  - Renamed `unpackToNoThrow` to `unpackTo` (the version that returns `Status`)
- `fix_format` reordered some bzl imports and removed unused ones

Signed-off-by: eric846 <56563761+eric846@users.noreply.github.com>
  • Loading branch information
eric846 authored Apr 1, 2024
1 parent a72952f commit ac98827
Show file tree
Hide file tree
Showing 28 changed files with 66 additions and 50 deletions.
2 changes: 1 addition & 1 deletion bazel/python_dependencies.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_python//python:pip.bzl", "pip_parse")
load("@python3_11//:defs.bzl", "interpreter")
load("@rules_python//python:pip.bzl", "pip_parse")

def nighthawk_python_dependencies():
pip_parse(
Expand Down
4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

ENVOY_COMMIT = "38c5c867ab92c60bb0fc32bde0f6565516ba0ff4"
ENVOY_SHA = "f6fb93e9c11c13bbee2234ffc43c6f525f3dd1294516885559bc930211f9b336"
ENVOY_COMMIT = "1f52a8e3c7fe1719ea83e1d79755e2de0f9689b4"
ENVOY_SHA = "abfdbc199535c340eb1f9ab894ecd56f8aabc0db2019d04870241189b06c9e08"

HDR_HISTOGRAM_C_VERSION = "0.11.2" # October 12th, 2020
HDR_HISTOGRAM_C_SHA = "637f28b5f64de2e268131e4e34e6eef0b91cf5ff99167db447d9b2825eae6bad"
Expand Down
2 changes: 1 addition & 1 deletion dynamic_config/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@nh_pip3//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary", "py_library")

licenses(["notice"]) # Apache 2

Expand Down
2 changes: 1 addition & 1 deletion source/adaptive_load/input_variable_setter_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ InputVariableSetterPtr RequestsPerSecondInputVariableSetterConfigFactory::create
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::RequestsPerSecondInputVariableSetterConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<RequestsPerSecondInputVariableSetter>(config);
}

Expand Down
4 changes: 2 additions & 2 deletions source/adaptive_load/scoring_function_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BinaryScoringFunctionConfigFactory::createScoringFunction(const Envoy::Protobuf:
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::BinaryScoringFunctionConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<BinaryScoringFunction>(config);
}

Expand Down Expand Up @@ -52,7 +52,7 @@ LinearScoringFunctionConfigFactory::createScoringFunction(const Envoy::Protobuf:
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::LinearScoringFunctionConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<LinearScoringFunction>(config);
}

Expand Down
4 changes: 2 additions & 2 deletions source/adaptive_load/step_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ absl::Status ExponentialSearchStepControllerConfigFactory::ValidateConfig(
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
ExponentialSearchStepControllerConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
if (config.has_input_variable_setter()) {
return LoadInputVariableSetterPlugin(config.input_variable_setter()).status();
}
Expand All @@ -66,7 +66,7 @@ StepControllerPtr ExponentialSearchStepControllerConfigFactory::createStepContro
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
ExponentialSearchStepControllerConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<ExponentialSearchStepController>(config, command_line_options_template);
}

Expand Down
30 changes: 23 additions & 7 deletions source/client/process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "external/envoy/source/common/api/api_impl.h"
#include "external/envoy/source/common/common/cleanup.h"
#include "external/envoy/source/common/common/regex.h"
#include "external/envoy/source/common/common/statusor.h"
#include "external/envoy/source/common/config/stats_utility.h"
#include "external/envoy/source/common/config/utility.h"
Expand Down Expand Up @@ -126,6 +127,20 @@ class StatsConfigImpl : public Envoy::Server::Configuration::StatsConfig {
const std::chrono::milliseconds flush_interval_;
};

// A fake ServerLifecycleNotifier. Because it does nothing, it's safe to just create
// multiple instances of it, rather than manage the lifetime of a single one.
class NighthawkLifecycleNotifierImpl : public Envoy::Server::ServerLifecycleNotifier {
public:
HandlePtr registerCallback(Stage, StageCallback) override {
PANIC(
"NighthawkLifecycleNotifierImpl::registerCallbacki(Stage, StageCallback) not implemented");
}
HandlePtr registerCallback(Stage, StageCallbackWithCompletion) override {
PANIC("NighthawkLifecycleNotifierImpl::registerCallback(Stage, StageCallbackWithCompletion) "
"not implemented");
}
};

// Implementation of Envoy::Server::Instance. Only methods used by Envoy's code
// when Nighthawk is running are implemented.
class NighthawkServerInstance : public Envoy::Server::Instance {
Expand Down Expand Up @@ -195,7 +210,7 @@ class NighthawkServerInstance : public Envoy::Server::Instance {
const Envoy::Server::Options& options() override { return options_; }
Envoy::Runtime::Loader& runtime() override { return runtime_; }
Envoy::Server::ServerLifecycleNotifier& lifecycleNotifier() override {
PANIC("NighthawkServerInstance::lifecycleNotifier not implemented");
return lifecycle_notifier_;
}
void shutdown() override { PANIC("NighthawkServerInstance::shutdown not implemented"); }
bool isShutdown() override { PANIC("NighthawkServerInstance::isShutdown not implemented"); }
Expand Down Expand Up @@ -263,6 +278,7 @@ class NighthawkServerInstance : public Envoy::Server::Instance {
Envoy::Grpc::Context& grpc_context_;
Envoy::Router::Context& router_context_;
Envoy::Server::Configuration::ServerFactoryContext& server_factory_context_;
NighthawkLifecycleNotifierImpl lifecycle_notifier_; // A no-op object that lives here.
};

// Implementation of Envoy::Server::Configuration::ServerFactoryContext.
Expand Down Expand Up @@ -321,12 +337,10 @@ class NighthawkServerFactoryContext : public Envoy::Server::Configuration::Serve
Envoy::AccessLog::AccessLogManager& accessLogManager() override { return log_manager_; }

Envoy::Server::ServerLifecycleNotifier& lifecycleNotifier() override {
PANIC("NighthawkServerFactoryContext::lifecycleNotifier not implemented");
};
return lifecycle_notifier_;
}

Envoy::Regex::Engine& regexEngine() override {
PANIC("NighthawkServerFactoryContext::regexEngine not implemented");
};
Envoy::Regex::Engine& regexEngine() override { return regex_engine_; }

Envoy::Init::Manager& initManager() override {
PANIC("NighthawkServerFactoryContext::initManager not implemented");
Expand Down Expand Up @@ -375,8 +389,10 @@ class NighthawkServerFactoryContext : public Envoy::Server::Configuration::Serve
Envoy::ProtobufMessage::ProdValidationContextImpl& validation_context_;
Envoy::Grpc::Context& grpc_context_;
Envoy::Router::Context& router_context_;
StatsConfigImpl stats_config_; // Using the default value.
StatsConfigImpl stats_config_; // Using the object created here.
Envoy::Stats::Scope& server_scope_;
NighthawkLifecycleNotifierImpl lifecycle_notifier_; // A no-op object that lives here.
Envoy::Regex::GoogleReEngine regex_engine_; // Using the object created here.
};

/**
Expand Down
4 changes: 2 additions & 2 deletions source/request_source/request_options_list_plugin_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RequestSourcePtr FileBasedOptionsListRequestSourceFactory::createRequestSourcePl
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::request_source::FileBasedOptionsListRequestSourceConfig config;
Envoy::MessageUtil util;
util.unpackTo(*any, config);
util.unpackToOrThrow(*any, config);
uint32_t max_file_size = config.has_max_file_size() ? config.max_file_size().value() : 1000000;
if (api.fileSystem().fileSize(config.file_path()) > max_file_size) {
throw NighthawkException("file size must be less than max_file_size");
Expand Down Expand Up @@ -60,7 +60,7 @@ RequestSourcePtr InLineOptionsListRequestSourceFactory::createRequestSourcePlugi
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::request_source::InLineOptionsListRequestSourceConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
auto loaded_list_ptr =
std::make_unique<const nighthawk::client::RequestOptionsList>(config.options_list());
return std::make_unique<OptionsListRequestSource>(config.num_requests(), std::move(header),
Expand Down
2 changes: 1 addition & 1 deletion source/user_defined_output/log_response_headers_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ absl::StatusOr<UserDefinedOutputPluginPtr>
LogResponseHeadersPluginFactory::createUserDefinedOutputPlugin(
const Envoy::ProtobufWkt::Any& config_any, const WorkerMetadata& worker_metadata) {
LogResponseHeadersConfig config;
absl::Status unpack_status = Envoy::MessageUtil::unpackToNoThrow(config_any, config);
absl::Status unpack_status = Envoy::MessageUtil::unpackTo(config_any, config);
if (!unpack_status.ok()) {
return unpack_status;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")
load(
"@envoy//bazel:envoy_build_system.bzl",
"envoy_cc_test",
"envoy_cc_test_library",
"envoy_package",
)
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")

licenses(["notice"]) # Apache 2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ InputVariableSetterPtr FakeInputVariableSetterConfigFactory::createInputVariable
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::FakeInputVariableSetterConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<FakeInputVariableSetter>(config);
}

Expand All @@ -50,7 +50,7 @@ absl::Status FakeInputVariableSetterConfigFactory::ValidateConfig(
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::FakeInputVariableSetterConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
if (config.has_artificial_validation_failure()) {
return StatusFromProtoRpcStatus(config.artificial_validation_failure());
}
Expand Down
2 changes: 1 addition & 1 deletion test/adaptive_load/fake_plugins/fake_metrics_plugin/BUILD
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")
load(
"@envoy//bazel:envoy_build_system.bzl",
"envoy_cc_test",
"envoy_cc_test_library",
"envoy_package",
)
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")

licenses(["notice"]) # Apache 2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ FakeMetricsPluginConfigFactory::createMetricsPlugin(const Envoy::Protobuf::Messa
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::FakeMetricsPluginConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<FakeMetricsPlugin>(config);
}

Expand All @@ -72,7 +72,7 @@ FakeMetricsPluginConfigFactory::ValidateConfig(const Envoy::Protobuf::Message& m
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::FakeMetricsPluginConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
if (config.has_artificial_validation_failure()) {
return GetStatusFromProtoRpcStatus(config.artificial_validation_failure());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ TEST(MakeFakeMetricsPluginTypedExtensionConfig, PacksGivenConfigProto) {
envoy::config::core::v3::TypedExtensionConfig activator =
MakeFakeMetricsPluginTypedExtensionConfig(expected_config);
nighthawk::adaptive_load::FakeMetricsPluginConfig actual_config;
Envoy::MessageUtil::unpackTo(activator.typed_config(), actual_config);
Envoy::MessageUtil::unpackToOrThrow(activator.typed_config(), actual_config);
EXPECT_THAT(expected_config, EqualsProto(actual_config));
}

Expand Down
2 changes: 1 addition & 1 deletion test/adaptive_load/fake_plugins/fake_step_controller/BUILD
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")
load(
"@envoy//bazel:envoy_build_system.bzl",
"envoy_cc_test",
"envoy_cc_test_library",
"envoy_package",
)
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")

licenses(["notice"]) # Apache 2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ StepControllerPtr FakeStepControllerConfigFactory::createStepController(
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::FakeStepControllerConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<FakeStepController>(config, command_line_options_template);
}

Expand All @@ -88,7 +88,7 @@ FakeStepControllerConfigFactory::ValidateConfig(const Envoy::Protobuf::Message&
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::FakeStepControllerConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
if (config.has_artificial_validation_failure()) {
return StatusFromProtoRpcStatus(config.artificial_validation_failure());
}
Expand Down
10 changes: 5 additions & 5 deletions test/adaptive_load/plugin_loader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ absl::Status DoValidateConfig(const Envoy::Protobuf::Message& message) {
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::LinearScoringFunctionConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return config.threshold() == kBadConfigThreshold
? absl::InvalidArgumentError("input validation failed")
: absl::OkStatus();
Expand Down Expand Up @@ -86,7 +86,7 @@ class TestInputVariableSetterConfigFactory : public InputVariableSetterConfigFac
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::LinearScoringFunctionConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<TestInputVariableSetter>(config);
}
};
Expand Down Expand Up @@ -125,7 +125,7 @@ class TestScoringFunctionConfigFactory : public ScoringFunctionConfigFactory {
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::LinearScoringFunctionConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<TestScoringFunction>(config);
}
};
Expand Down Expand Up @@ -165,7 +165,7 @@ class TestMetricsPluginConfigFactory : public MetricsPluginConfigFactory {
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::LinearScoringFunctionConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<TestMetricsPlugin>(config);
}
};
Expand Down Expand Up @@ -216,7 +216,7 @@ class TestStepControllerConfigFactory : public StepControllerConfigFactory {
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::adaptive_load::LinearScoringFunctionConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<TestStepController>(config, command_line_options_template);
}
};
Expand Down
8 changes: 4 additions & 4 deletions test/benchmark_http_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ TEST_F(BenchmarkClientHttpTest, CallsUserDefinedPluginHandleHeaders) {
absl::StatusOr<Envoy::ProtobufWkt::Any> output_any = plugin_ptr->getPerWorkerOutput();
ASSERT_TRUE(output_any.ok());
nighthawk::FakeUserDefinedOutput output;
ASSERT_TRUE(Envoy::MessageUtil::unpackToNoThrow(*output_any, output).ok());
ASSERT_TRUE(Envoy::MessageUtil::unpackTo(*output_any, output).ok());
EXPECT_EQ(output.headers_called(), 2);
EXPECT_EQ(getCounter("user_defined_plugin_handle_headers_failure"), 0);
}
Expand Down Expand Up @@ -524,7 +524,7 @@ TEST_F(BenchmarkClientHttpTest, IncrementsCounterWhenUserDefinedPluginHandleHead
absl::StatusOr<Envoy::ProtobufWkt::Any> output_any = plugin_ptr->getPerWorkerOutput();
ASSERT_TRUE(output_any.ok());
nighthawk::FakeUserDefinedOutput output;
ASSERT_TRUE(Envoy::MessageUtil::unpackToNoThrow(*output_any, output).ok());
ASSERT_TRUE(Envoy::MessageUtil::unpackTo(*output_any, output).ok());
EXPECT_EQ(output.headers_called(), 2);
EXPECT_EQ(getCounter("user_defined_plugin_handle_headers_failure"), 2);
}
Expand All @@ -551,7 +551,7 @@ TEST_F(BenchmarkClientHttpTest, CallsUserDefinedPluginHandleData) {
absl::StatusOr<Envoy::ProtobufWkt::Any> output_any = plugin_ptr->getPerWorkerOutput();
ASSERT_TRUE(output_any.ok());
nighthawk::FakeUserDefinedOutput output;
ASSERT_TRUE(Envoy::MessageUtil::unpackToNoThrow(*output_any, output).ok());
ASSERT_TRUE(Envoy::MessageUtil::unpackTo(*output_any, output).ok());
EXPECT_EQ(output.data_called(), 2);
EXPECT_EQ(getCounter("user_defined_plugin_handle_data_failure"), 0);
}
Expand Down Expand Up @@ -580,7 +580,7 @@ TEST_F(BenchmarkClientHttpTest, IncrementsCounterWhenUserDefinedPluginHandleData
absl::StatusOr<Envoy::ProtobufWkt::Any> output_any = plugin_ptr->getPerWorkerOutput();
ASSERT_TRUE(output_any.ok());
nighthawk::FakeUserDefinedOutput output;
ASSERT_TRUE(Envoy::MessageUtil::unpackToNoThrow(*output_any, output).ok());
ASSERT_TRUE(Envoy::MessageUtil::unpackTo(*output_any, output).ok());
EXPECT_EQ(output.data_called(), 2);
EXPECT_EQ(getCounter("user_defined_plugin_handle_data_failure"), 2);
}
Expand Down
2 changes: 1 addition & 1 deletion test/dynamic_config/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_python//python:defs.bzl", "py_test")
load("@nh_pip3//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_test")

licenses(["notice"]) # Apache 2

Expand Down
2 changes: 1 addition & 1 deletion test/integration/BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
load(
"@envoy//bazel:envoy_build_system.bzl",
"envoy_package",
)
load("@nh_pip3//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary", "py_library")

licenses(["notice"]) # Apache 2

Expand Down
2 changes: 1 addition & 1 deletion test/integration/unit_tests/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_python//python:defs.bzl", "py_test")
load("@nh_pip3//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_test")

licenses(["notice"]) # Apache 2

Expand Down
4 changes: 2 additions & 2 deletions test/options_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ TEST_F(OptionsImplTest, AlmostAll) {
EXPECT_EQ(options->userDefinedOutputPluginConfigs().size(), 1);
envoy::config::core::v3::TypedExtensionConfig extension_config =
options->userDefinedOutputPluginConfigs()[0];
EXPECT_TRUE(Envoy::MessageUtil::unpackToNoThrow(extension_config.typed_config(),
actual_user_defined_output_config)
EXPECT_TRUE(Envoy::MessageUtil::unpackTo(extension_config.typed_config(),
actual_user_defined_output_config)
.ok());
EXPECT_THAT(actual_user_defined_output_config, EqualsProto(expected_user_defined_output_config));

Expand Down
2 changes: 1 addition & 1 deletion test/request_source/stub_plugin_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RequestSourcePtr StubRequestSourcePluginConfigFactory::createRequestSourcePlugin
const auto* any =
Envoy::Protobuf::DynamicCastToGenerated<const Envoy::ProtobufWkt::Any>(&message);
nighthawk::request_source::StubPluginConfig config;
Envoy::MessageUtil::unpackTo(*any, config);
Envoy::MessageUtil::unpackToOrThrow(*any, config);
return std::make_unique<StubRequestSource>(config);
}

Expand Down
Loading

0 comments on commit ac98827

Please sign in to comment.