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
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 = "867b9e23d2e48350bd1b0d1fbc392a8355f20e35" # December 20th, 2020
ENVOY_SHA = "b98a88bbff0c64ff08f88d2a4379dd708d1df012424d6b65c7e32773ce249a53"
ENVOY_COMMIT = "937f0133355cf2d8eb9e75d3f09e296bb63951be" # Jan 5th, 2021
ENVOY_SHA = "5bdb98e2f2bad83ac672862e399e4ae2d0ca28c31740a3af16d154fc37401ca7"

HDR_HISTOGRAM_C_VERSION = "0.11.2" # October 12th, 2020
HDR_HISTOGRAM_C_SHA = "637f28b5f64de2e268131e4e34e6eef0b91cf5ff99167db447d9b2825eae6bad"
Expand Down
3 changes: 2 additions & 1 deletion source/client/process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ ProcessImpl::ProcessImpl(const Options& options, Envoy::Event::TimeSystem& time_
request_generator_factory_(options, *api_), options_(options),
init_manager_("nh_init_manager"),
local_info_(new Envoy::LocalInfo::LocalInfoImpl(
{}, Envoy::Network::Utility::getLocalAddress(Envoy::Network::Address::IpVersion::v4),
store_root_.symbolTable(), {},
Envoy::Network::Utility::getLocalAddress(Envoy::Network::Address::IpVersion::v4),
"nighthawk_service_zone", "nighthawk_service_cluster", "nighthawk_service_node")),
secret_manager_(config_tracker_), http_context_(store_root_.symbolTable()),
grpc_context_(store_root_.symbolTable()),
Expand Down
74 changes: 35 additions & 39 deletions test/common/nighthawk_service_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TEST(PerformNighthawkBenchmark, UsesSpecifiedCommandLineOptions) {
// Configure the mock Nighthawk Service stub to return an inner mock channel when the code under
// test requests a channel. Set call expectations on the inner mock channel.
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw)
.WillOnce([&request](grpc_impl::ClientContext*) {
.WillOnce([&request](grpc::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
// PerformNighthawkBenchmark currently expects Read to return true exactly once.
Expand Down Expand Up @@ -61,7 +61,7 @@ TEST(PerformNighthawkBenchmark, ReturnsNighthawkResponseSuccessfully) {
// Configure the mock Nighthawk Service stub to return an inner mock channel when the code under
// test requests a channel. Set call expectations on the inner mock channel.
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw)
.WillOnce([&expected_response](grpc_impl::ClientContext*) {
.WillOnce([&expected_response](grpc::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
// PerformNighthawkBenchmark currently expects Read to return true exactly once.
Expand All @@ -88,15 +88,14 @@ TEST(PerformNighthawkBenchmark, ReturnsErrorIfNighthawkServiceDoesNotSendRespons
nighthawk::client::MockNighthawkServiceStub mock_nighthawk_service_stub;
// Configure the mock Nighthawk Service stub to return an inner mock channel when the code under
// test requests a channel. Set call expectations on the inner mock channel.
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw)
.WillOnce([](grpc_impl::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
EXPECT_CALL(*mock_reader_writer, Read(_)).WillOnce(Return(false));
EXPECT_CALL(*mock_reader_writer, Write(_, _)).WillOnce(Return(true));
EXPECT_CALL(*mock_reader_writer, WritesDone()).WillOnce(Return(true));
return mock_reader_writer;
});
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw).WillOnce([](grpc::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
EXPECT_CALL(*mock_reader_writer, Read(_)).WillOnce(Return(false));
EXPECT_CALL(*mock_reader_writer, Write(_, _)).WillOnce(Return(true));
EXPECT_CALL(*mock_reader_writer, WritesDone()).WillOnce(Return(true));
return mock_reader_writer;
});

NighthawkServiceClientImpl client;
absl::StatusOr<ExecutionResponse> response_or =
Expand All @@ -111,13 +110,12 @@ TEST(PerformNighthawkBenchmark, ReturnsErrorIfNighthawkServiceWriteFails) {
nighthawk::client::MockNighthawkServiceStub mock_nighthawk_service_stub;
// Configure the mock Nighthawk Service stub to return an inner mock channel when the code under
// test requests a channel. Set call expectations on the inner mock channel.
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw)
.WillOnce([](grpc_impl::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
EXPECT_CALL(*mock_reader_writer, Write(_, _)).WillOnce(Return(false));
return mock_reader_writer;
});
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw).WillOnce([](grpc::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
EXPECT_CALL(*mock_reader_writer, Write(_, _)).WillOnce(Return(false));
return mock_reader_writer;
});

NighthawkServiceClientImpl client;
absl::StatusOr<ExecutionResponse> response_or =
Expand All @@ -131,14 +129,13 @@ TEST(PerformNighthawkBenchmark, ReturnsErrorIfNighthawkServiceWritesDoneFails) {
nighthawk::client::MockNighthawkServiceStub mock_nighthawk_service_stub;
// Configure the mock Nighthawk Service stub to return an inner mock channel when the code under
// test requests a channel. Set call expectations on the inner mock channel.
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw)
.WillOnce([](grpc_impl::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
EXPECT_CALL(*mock_reader_writer, Write(_, _)).WillOnce(Return(true));
EXPECT_CALL(*mock_reader_writer, WritesDone()).WillOnce(Return(false));
return mock_reader_writer;
});
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw).WillOnce([](grpc::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
EXPECT_CALL(*mock_reader_writer, Write(_, _)).WillOnce(Return(true));
EXPECT_CALL(*mock_reader_writer, WritesDone()).WillOnce(Return(false));
return mock_reader_writer;
});

NighthawkServiceClientImpl client;
absl::StatusOr<ExecutionResponse> response_or =
Expand All @@ -152,19 +149,18 @@ TEST(PerformNighthawkBenchmark, PropagatesErrorIfNighthawkServiceGrpcStreamClose
nighthawk::client::MockNighthawkServiceStub mock_nighthawk_service_stub;
// Configure the mock Nighthawk Service stub to return an inner mock channel when the code under
// test requests a channel. Set call expectations on the inner mock channel.
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw)
.WillOnce([](grpc_impl::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
// PerformNighthawkBenchmark currently expects Read to return true exactly once.
EXPECT_CALL(*mock_reader_writer, Read(_)).WillOnce(Return(true)).WillOnce(Return(false));
EXPECT_CALL(*mock_reader_writer, Write(_, _)).WillOnce(Return(true));
EXPECT_CALL(*mock_reader_writer, WritesDone()).WillOnce(Return(true));
EXPECT_CALL(*mock_reader_writer, Finish())
.WillOnce(
Return(::grpc::Status(::grpc::PERMISSION_DENIED, "Finish failure status message")));
return mock_reader_writer;
});
EXPECT_CALL(mock_nighthawk_service_stub, ExecutionStreamRaw).WillOnce([](grpc::ClientContext*) {
auto* mock_reader_writer =
new grpc::testing::MockClientReaderWriter<ExecutionRequest, ExecutionResponse>();
// PerformNighthawkBenchmark currently expects Read to return true exactly once.
EXPECT_CALL(*mock_reader_writer, Read(_)).WillOnce(Return(true)).WillOnce(Return(false));
EXPECT_CALL(*mock_reader_writer, Write(_, _)).WillOnce(Return(true));
EXPECT_CALL(*mock_reader_writer, WritesDone()).WillOnce(Return(true));
EXPECT_CALL(*mock_reader_writer, Finish())
.WillOnce(
Return(::grpc::Status(::grpc::PERMISSION_DENIED, "Finish failure status message")));
return mock_reader_writer;
});

NighthawkServiceClientImpl client;
absl::StatusOr<ExecutionResponse> response_or =
Expand Down