Skip to content

Commit 6dc2b06

Browse files
committed
deps: bump up googletest to v1.17.0
Signed-off-by: Rohit Agrawal <[email protected]>
1 parent 4c8c535 commit 6dc2b06

16 files changed

+83
-43
lines changed

bazel/googletest.patch

+39-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
1+
From b217f1131adb21e2c1193782d2659ae03840659a Mon Sep 17 00:00:00 2001
2+
From: Rohit Agrawal <[email protected]>
3+
Date: Sat, 3 May 2025 00:29:17 +0900
4+
Subject: [PATCH] Patches
5+
6+
---
7+
BUILD.bazel | 17 -----------------
8+
1 file changed, 17 deletions(-)
9+
110
diff --git a/BUILD.bazel b/BUILD.bazel
2-
index 8099642a85..3598661079 100644
11+
index 53501454ce..fff6e491e7 100644
312
--- a/BUILD.bazel
413
+++ b/BUILD.bazel
5-
@@ -40,7 +40,7 @@ exports_files(["LICENSE"])
6-
7-
config_setting(
8-
name = "windows",
9-
- constraint_values = ["@bazel_tools//platforms:windows"],
10-
+ constraint_values = ["@platforms//os:windows"],
14+
@@ -56,12 +56,6 @@ config_setting(
15+
constraint_values = ["@platforms//os:openbsd"],
1116
)
12-
17+
18+
-# NOTE: Fuchsia is not an officially supported platform.
19+
-config_setting(
20+
- name = "fuchsia",
21+
- constraint_values = ["@platforms//os:fuchsia"],
22+
-)
23+
-
1324
config_setting(
25+
name = "msvc_compiler",
26+
flag_values = {
27+
@@ -157,17 +151,6 @@ cc_library(
28+
"@re2//:re2",
29+
],
30+
"//conditions:default": [],
31+
- }) + select({
32+
- # `gtest-death-test.cc` has `EXPECT_DEATH` that spawns a process,
33+
- # expects it to crash and inspects its logs with the given matcher,
34+
- # so that's why these libraries are needed.
35+
- # Otherwise, builds targeting Fuchsia would fail to compile.
36+
- ":fuchsia": [
37+
- "@fuchsia_sdk//pkg/fdio",
38+
- "@fuchsia_sdk//pkg/syslog",
39+
- "@fuchsia_sdk//pkg/zx",
40+
- ],
41+
- "//conditions:default": [],
42+
}),
43+
)
44+

bazel/repositories.bzl

+2-1
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,10 @@ def _com_github_ncopa_suexec():
571571

572572
def _com_google_googletest():
573573
external_http_archive(
574-
"com_google_googletest",
574+
name = "com_google_googletest",
575575
patches = ["@envoy//bazel:googletest.patch"],
576576
patch_args = ["-p1"],
577+
repo_mapping = {"@abseil-cpp": "@com_google_absl", "@re2": "@com_googlesource_code_re2"},
577578
)
578579

579580
# TODO(jmarantz): replace the use of bind and external_deps with just

bazel/repository_locations.bzl

+4-6
Original file line numberDiff line numberDiff line change
@@ -910,13 +910,11 @@ REPOSITORY_LOCATIONS_SPEC = dict(
910910
project_name = "Google Test",
911911
project_desc = "Google's C++ test framework",
912912
project_url = "https://github.com/google/googletest",
913-
# Pick up fix for MOCK_METHOD compilation with clang-cl for Windows (resolved after 1.10.0)
914-
# see https://github.com/google/googletest/issues/2490
915-
version = "a4ab0abb93620ce26efad9de9296b73b16e88588",
916-
sha256 = "7897bfaa5ad39a479177cfb5c3ce010184dbaee22a7c3727b212282871918751",
913+
version = "1.17.0",
914+
sha256 = "65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c",
917915
strip_prefix = "googletest-{version}",
918-
urls = ["https://github.com/google/googletest/archive/{version}.tar.gz"],
919-
release_date = "2020-09-10",
916+
urls = ["https://github.com/google/googletest/releases/download/v{version}/googletest-{version}.tar.gz"],
917+
release_date = "2025-04-30",
920918
use_category = ["test_only"],
921919
cpe = "cpe:2.3:a:google:google_test:*",
922920
license = "BSD-3-Clause",

test/common/common/BUILD

+2
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ envoy_cc_test(
207207
rbe_pool = "6gig",
208208
deps = [
209209
"//source/common/common:minimal_logger_lib",
210+
"//test/mocks/http:http_mocks",
211+
"//test/mocks/network:network_mocks",
210212
"//test/test_common:logging_lib",
211213
],
212214
)

test/common/http/header_mutation_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ TEST(HeaderMutationTest, Death) {
276276
ProtoHeaderMutatons proto_mutations;
277277
proto_mutations.Add();
278278

279-
EXPECT_DEATH(HeaderMutations::create(proto_mutations).IgnoreError(), "unset oneof");
279+
EXPECT_DEATH(HeaderMutations::create(proto_mutations).IgnoreError(), ".*unset oneof.*");
280280
}
281281

282282
} // namespace

test/common/quic/envoy_quic_proof_verifier_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ TEST_F(EnvoyQuicProofVerifierTest, VerifyProof) {
446446
configCertVerificationDetails(true);
447447
EXPECT_DEATH(verifier_->VerifyProof("", 0, "", quic::QUIC_VERSION_IETF_RFC_V1, "", {}, "", "",
448448
nullptr, nullptr, nullptr, {}),
449-
"not implemented");
449+
".*not implemented.*");
450450
}
451451

452452
TEST_F(EnvoyQuicProofVerifierTest, CreateDefaultContext) {

test/common/quic/quic_filter_manager_connection_impl_test.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ TEST_F(QuicFilterManagerConnectionImplTest, RawWrite) {
114114
}
115115

116116
TEST_F(QuicFilterManagerConnectionImplTest, BufferLimit) {
117-
EXPECT_DEATH(impl_.bufferLimit(), "not implemented");
117+
EXPECT_DEATH(impl_.bufferLimit(), ".*not implemented.*");
118118
}
119119

120120
TEST_F(QuicFilterManagerConnectionImplTest, SetBufferLimits) {
@@ -127,12 +127,11 @@ TEST_F(QuicFilterManagerConnectionImplTest, CloseConnection) {
127127
}
128128

129129
TEST_F(QuicFilterManagerConnectionImplTest, GetWriteBuffer) {
130-
EXPECT_DEATH(impl_.getWriteBuffer(), "not implemented");
130+
EXPECT_DEATH(impl_.getWriteBuffer(), ".*not implemented.*");
131131
}
132132

133133
TEST_F(QuicFilterManagerConnectionImplTest, EnableHalfClose) {
134-
impl_.enableHalfClose(false); // No-op
135-
EXPECT_DEATH(impl_.enableHalfClose(true), "Quic connection doesn't support half close.");
134+
EXPECT_DEATH(impl_.enableHalfClose(true), ".*Quic connection doesn't support half close.*");
136135
}
137136

138137
TEST_F(QuicFilterManagerConnectionImplTest, IsHalfCloseEnabled) {

test/common/runtime/BUILD

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ envoy_cc_test(
6464
name = "runtime_flag_override_test",
6565
srcs = ["runtime_flag_override_test.cc"],
6666
args = [
67+
"--",
6768
"--runtime-feature-override-for-tests=envoy.reloadable_features.test_feature_false",
6869
"--runtime-feature-disable-for-tests=envoy.reloadable_features.test_feature_true",
6970
],
@@ -78,6 +79,7 @@ envoy_cc_test(
7879
name = "runtime_flag_override_noop_test",
7980
srcs = ["runtime_flag_override_noop_test.cc"],
8081
args = [
82+
"--",
8183
"--runtime-feature-override-for-tests=envoy.reloadable_features.test_feature_true",
8284
"--runtime-feature-disable-for-tests=envoy.reloadable_features.test_feature_false",
8385
],

test/extensions/filters/http/kill_request/kill_request_filter_test.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ TEST_F(KillRequestFilterTest, KillRequestCrashEnvoy) {
4747

4848
ON_CALL(random_generator_, random()).WillByDefault(Return(0));
4949
EXPECT_DEATH(filter_->decodeHeaders(request_headers_, false),
50-
"KillRequestFilter is crashing Envoy!!!");
50+
".*KillRequestFilter is crashing Envoy!!!.*");
5151
}
5252

5353
TEST_F(KillRequestFilterTest, KillRequestCrashEnvoyWithCustomKillHeader) {
@@ -59,7 +59,7 @@ TEST_F(KillRequestFilterTest, KillRequestCrashEnvoyWithCustomKillHeader) {
5959

6060
ON_CALL(random_generator_, random()).WillByDefault(Return(0));
6161
EXPECT_DEATH(filter_->decodeHeaders(request_headers_, false),
62-
"KillRequestFilter is crashing Envoy!!!");
62+
".*KillRequestFilter is crashing Envoy!!!.*");
6363
}
6464

6565
TEST_F(KillRequestFilterTest, KillRequestWithMillionDenominatorCrashEnvoy) {
@@ -183,7 +183,7 @@ TEST_F(KillRequestFilterTest, CanKillOnResponse) {
183183
ON_CALL(random_generator_, random()).WillByDefault(Return(0));
184184
response_headers_.addCopy("x-envoy-kill-request", "true");
185185
EXPECT_DEATH(filter_->encodeHeaders(response_headers_, false),
186-
"KillRequestFilter is crashing Envoy!!!");
186+
".*KillRequestFilter is crashing Envoy!!!.*");
187187
}
188188

189189
TEST_F(KillRequestFilterTest, KillsBasedOnDirection) {
@@ -201,7 +201,7 @@ TEST_F(KillRequestFilterTest, KillsBasedOnDirection) {
201201
ON_CALL(random_generator_, random()).WillByDefault(Return(0));
202202
response_headers_.addCopy("x-envoy-kill-request", "true");
203203
EXPECT_DEATH(filter_->encodeHeaders(response_headers_, false),
204-
"KillRequestFilter is crashing Envoy!!!");
204+
".*KillRequestFilter is crashing Envoy!!!.*");
205205
}
206206

207207
TEST_F(KillRequestFilterTest, PerRouteKillSettingFound) {

test/extensions/matching/input_matchers/cel_matcher/cel_matcher_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ TEST_F(CelMatcherTest, CelMatcherRequestResponseNotMatchedWithParsedExprUseCel)
562562

563563
TEST_F(CelMatcherTest, NoCelExpression) {
564564
EXPECT_DEATH(buildMatcherTree(RequestHeaderCelExprString, ExpressionType::NoExpression),
565-
".*panic: unset oneof.*");
565+
".*unset oneof.*");
566566
}
567567

568568
} // namespace CelMatcher

test/fuzz/fuzz_runner.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void runCleanupHooks() {
8787
extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
8888
// Before parsing gmock flags, set the default value of flag --gmock_verbose to "error".
8989
// This suppresses logs from NiceMock objects, which can be noisy and provide little value.
90-
testing::GMOCK_FLAG(verbose) = "error";
90+
GMOCK_FLAG_SET(verbose, "error");
9191
testing::InitGoogleMock(argc, *argv);
9292
Envoy::Fuzz::Runner::setupEnvironment(1, *argv, spdlog::level::critical);
9393
atexit(Envoy::Fuzz::runCleanupHooks);

test/integration/BUILD

+3-3
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ envoy_cc_test_library(
11421142
hdrs = [
11431143
"fake_upstream.h",
11441144
],
1145-
rbe_pool = "6gig",
1145+
rbe_pool = "12gig", # Increased from 6gig to prevent OOM kills during compilation
11461146
deps = [
11471147
":utility_lib",
11481148
"//envoy/api:api_interface",
@@ -1222,7 +1222,7 @@ envoy_cc_test_library(
12221222
hdrs = [
12231223
"base_integration_test.h",
12241224
],
1225-
rbe_pool = "6gig",
1225+
rbe_pool = "12gig", # Increased from 6gig to prevent OOM kills during compilation
12261226
deps = [
12271227
":async_round_robin_lb",
12281228
":autonomous_upstream_lib",
@@ -1267,7 +1267,7 @@ envoy_cc_test_library(
12671267
hdrs = [
12681268
"autonomous_upstream.h",
12691269
],
1270-
rbe_pool = "6gig",
1270+
rbe_pool = "12gig", # Increased from 6gig to prevent OOM kills during compilation
12711271
deps = [
12721272
":fake_upstream_lib",
12731273
],

test/integration/tcp_proxy_odcds_integration_test.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, SingleTcpClient) {
163163
ASSERT_TRUE(fake_upstream_connection->waitForDisconnect());
164164
tcp_client->waitForHalfClose();
165165
tcp_client->close();
166-
assertOnDemandCounters(1, 0, 0);
166+
ASSERT_TRUE(assertOnDemandCounters(1, 0, 0));
167167
}
168168

169169
// Verify only one delta xds response is needed for multiple tcp_proxy requests.
@@ -249,7 +249,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnTimeout) {
249249

250250
tcp_client->waitForHalfClose();
251251
tcp_client->close();
252-
assertOnDemandCounters(0, 0, 1);
252+
ASSERT_TRUE(assertOnDemandCounters(0, 0, 1));
253253
}
254254

255255
TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnClusterMissing) {
@@ -277,7 +277,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnClusterMissing) {
277277

278278
tcp_client->waitForHalfClose();
279279
tcp_client->close();
280-
assertOnDemandCounters(0, 1, 0);
280+
ASSERT_TRUE(assertOnDemandCounters(0, 1, 0));
281281
}
282282

283283
TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownAllConnectionsOnClusterLookupTimeout) {
@@ -306,7 +306,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownAllConnectionsOnClusterLookupTimeou
306306

307307
tcp_client_1->waitForHalfClose(true);
308308
tcp_client_2->waitForHalfClose(true);
309-
assertOnDemandCounters(0, 0, 2);
309+
ASSERT_TRUE(assertOnDemandCounters(0, 0, 2));
310310
tcp_client_1->close();
311311
tcp_client_2->close();
312312
}
@@ -331,7 +331,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownTcpClientBeforeOdcdsResponse) {
331331
EXPECT_EQ(1, test_server_->counter("tcp.tcpproxy_stats.on_demand_cluster_attempt")->value());
332332
// Client disconnect when the tcp proxy is waiting for the on demand response.
333333
tcp_client->close();
334-
assertOnDemandCounters(0, 0, 0);
334+
ASSERT_TRUE(assertOnDemandCounters(0, 0, 0));
335335
}
336336

337337
} // namespace

test/server/guarddog_impl_test.cc

+5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ class GuardDogDeathTest : public GuardDogTestBase {
9393
config_multikill_(1000, 1000, 1000, 500, 0, std::vector<std::string>{}),
9494
config_multikill_threshold_(1000, 1000, 1000, 500, 60, std::vector<std::string>{}) {}
9595

96+
void SetUp() override {
97+
GTEST_FLAG_SET(death_test_style, "threadsafe");
98+
GuardDogTestBase::SetUp();
99+
}
100+
96101
/**
97102
* This does everything but the final forceCheckForTest() that should cause
98103
* death for the single kill case.

test/test_common/test_random_generator.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#include "test/test_common/test_random_generator.h"
22

3+
#include "absl/flags/flag.h"
34
#include "gtest/gtest.h"
4-
5-
using testing::GTEST_FLAG(random_seed);
5+
#include "gtest/internal/gtest-port.h" // for GTEST_FLAG_GET
66

77
namespace Envoy {
88

99
// The purpose of using the static seed here is to use --test_arg=--gtest_random_seed=[seed]
10-
// to specify the seed of the problem to replay.
10+
// to specify the seed for a given test run.
1111
int32_t getSeed() {
12-
static const int32_t seed = std::chrono::duration_cast<std::chrono::nanoseconds>(
12+
return static_cast<int32_t>(std::chrono::duration_cast<std::chrono::nanoseconds>(
1313
std::chrono::system_clock::now().time_since_epoch())
14-
.count();
15-
return seed;
14+
.count());
1615
}
1716

1817
TestRandomGenerator::TestRandomGenerator()
19-
: seed_(GTEST_FLAG(random_seed) == 0 ? getSeed() : GTEST_FLAG(random_seed)), generator_(seed_) {
18+
: seed_(GTEST_FLAG_GET(random_seed) == 0 ? getSeed() : GTEST_FLAG_GET(random_seed)),
19+
generator_(seed_) {
2020
ENVOY_LOG_MISC(info, "TestRandomGenerator running with seed {}", seed_);
2121
}
2222

test/test_runner.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include "test/test_listener.h"
1616

1717
#include "gmock/gmock.h"
18+
#include "gtest/gtest.h"
19+
#include "gtest/internal/gtest-port.h" // for GTEST_FLAG_SET
1820

1921
namespace Envoy {
2022

@@ -90,7 +92,7 @@ int TestRunner::runTests(int argc, char** argv) {
9092

9193
// Use the recommended, but not default, "threadsafe" style for the Death Tests.
9294
// See: https://github.com/google/googletest/commit/84ec2e0365d791e4ebc7ec249f09078fb5ab6caa
93-
::testing::FLAGS_gtest_death_test_style = "threadsafe";
95+
GTEST_FLAG_SET(death_test_style, "threadsafe");
9496

9597
// Set gtest properties
9698
// (https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#logging-additional-information),

0 commit comments

Comments
 (0)