Skip to content

Commit 40f2c2a

Browse files
authored
Upgrade googletest (grpc#27287)
1 parent 8de825b commit 40f2c2a

File tree

9 files changed

+47
-65
lines changed

9 files changed

+47
-65
lines changed

bazel/copts.bzl

-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ GRPC_LLVM_WARNING_FLAGS = [
5454
# Exceptions but will be removed
5555
"-Wno-deprecated-declarations",
5656
"-Wno-unused-function",
57-
# googletest 1.11 or later is needed to have this warning
58-
# https://github.com/google/googletest/commit/1b3eb6ef34620c1203263d76ec169ef0853789cc
59-
"-Wno-deprecated-copy",
6057
]
6158

6259
GRPC_DEFAULT_COPTS = select({

bazel/grpc_deps.bzl

+4-5
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,11 @@ def grpc_deps():
226226
if "com_google_googletest" not in native.existing_rules():
227227
http_archive(
228228
name = "com_google_googletest",
229-
sha256 = "443d383db648ebb8e391382c0ab63263b7091d03197f304390baac10f178a468",
230-
strip_prefix = "googletest-c9ccac7cb7345901884aabf5d1a786cfa6e2f397",
229+
sha256 = "c8de6c60e12ad014a28225c5247ee735861d85cf906df617f6a29954ca05f547",
230+
strip_prefix = "googletest-0e402173c97aea7a00749e825b194bfede4f2e45",
231231
urls = [
232-
# 2019-08-19
233-
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/googletest/archive/c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz",
234-
"https://github.com/google/googletest/archive/c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz",
232+
# 2022-02-09
233+
"https://github.com/google/googletest/archive/0e402173c97aea7a00749e825b194bfede4f2e45.tar.gz",
235234
],
236235
)
237236

test/cpp/end2end/grpclb_end2end_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ TEST_F(SingleBalancerTest, SecureNaming) {
971971
}
972972

973973
TEST_F(SingleBalancerTest, SecureNamingDeathTest) {
974-
GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
974+
GTEST_FLAG_SET(death_test_style, "threadsafe");
975975
// Make sure that we blow up (via abort() from the security connector) when
976976
// the name from the balancer doesn't match expectations.
977977
ASSERT_DEATH_IF_SUPPORTED(

test/cpp/end2end/rls_end2end_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ TEST_F(RlsEnd2endTest, ConnectivityStateTransientFailure) {
14421442
}
14431443

14441444
TEST_F(RlsEnd2endTest, RlsAuthorityDeathTest) {
1445-
GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
1445+
GTEST_FLAG_SET(death_test_style, "threadsafe");
14461446
ResetStub("incorrect_authority");
14471447
SetNextResolution(
14481448
MakeServiceConfigBuilder()

test/cpp/end2end/xds/xds_end2end_test.cc

+38-47
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,7 @@ TEST_P(SecureNamingTest, TargetNameIsExpected) {
30163016

30173017
// Tests that secure naming check fails if target name is unexpected.
30183018
TEST_P(SecureNamingTest, TargetNameIsUnexpected) {
3019-
GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
3019+
GTEST_FLAG_SET(death_test_style, "threadsafe");
30203020
CreateClientsAndServers(BootstrapBuilder(),
30213021
/*lb_expected_authority=*/"incorrect_server_name");
30223022
StartAllBackends();
@@ -13142,29 +13142,28 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpVanilla) {
1314213142
matchers = {
1314313143
// Listener
1314413144
EqGenericXdsConfig(
13145-
kLdsTypeUrl, kServerName, /*version_info=*/"1",
13145+
kLdsTypeUrl, kServerName, "1",
1314613146
UnpackListener(EqListener(kServerName, api_listener_matcher)),
13147-
ClientResourceStatus::ACKED, /*error_state=*/::testing::_),
13147+
ClientResourceStatus::ACKED, ::testing::_),
1314813148
// Cluster
13149-
EqGenericXdsConfig(
13150-
kCdsTypeUrl, kDefaultClusterName, /*version_info=*/"1",
13151-
UnpackCluster(EqCluster(kDefaultClusterName)),
13152-
ClientResourceStatus::ACKED, /*error_state=*/::testing::_),
13149+
EqGenericXdsConfig(kCdsTypeUrl, kDefaultClusterName, "1",
13150+
UnpackCluster(EqCluster(kDefaultClusterName)),
13151+
ClientResourceStatus::ACKED, ::testing::_),
1315313152
// ClusterLoadAssignment
1315413153
EqGenericXdsConfig(
13155-
kEdsTypeUrl, kDefaultEdsServiceName, /*version_info=*/"1",
13154+
kEdsTypeUrl, kDefaultEdsServiceName, "1",
1315613155
UnpackClusterLoadAssignment(EqClusterLoadAssignment(
1315713156
kDefaultEdsServiceName, backends_[0]->port(),
1315813157
kDefaultLocalityWeight)),
13159-
ClientResourceStatus::ACKED, /*error_state=*/::testing::_),
13158+
ClientResourceStatus::ACKED, ::testing::_),
1316013159
};
1316113160
// If RDS is enabled, add matcher for RDS resource.
1316213161
if (GetParam().enable_rds_testing()) {
1316313162
matchers.push_back(EqGenericXdsConfig(
13164-
kRdsTypeUrl, kDefaultRouteConfigurationName, /*version_info=*/"1",
13163+
kRdsTypeUrl, kDefaultRouteConfigurationName, "1",
1316513164
UnpackRouteConfiguration(EqRouteConfiguration(
1316613165
kDefaultRouteConfigurationName, kDefaultClusterName)),
13167-
ClientResourceStatus::ACKED, /*error_state=*/::testing::_));
13166+
ClientResourceStatus::ACKED, ::testing::_));
1316813167
}
1316913168
// Validate the dumped xDS configs
1317013169
EXPECT_THAT(client_config.generic_xds_configs(),
@@ -13204,7 +13203,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpListenerError) {
1320413203
bool ok = ::testing::Value(
1320513204
csds_response.config(0).generic_xds_configs(),
1320613205
::testing::Contains(EqGenericXdsConfig(
13207-
kLdsTypeUrl, kServerName, /*version_info=*/"1",
13206+
kLdsTypeUrl, kServerName, "1",
1320813207
UnpackListener(EqListener(kServerName, api_listener_matcher)),
1320913208
ClientResourceStatus::NACKED,
1321013209
EqUpdateFailureState(
@@ -13239,7 +13238,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpRouteError) {
1323913238
ok = ::testing::Value(
1324013239
csds_response.config(0).generic_xds_configs(),
1324113240
::testing::Contains(EqGenericXdsConfig(
13242-
kRdsTypeUrl, kDefaultRouteConfigurationName, /*version_info=*/"1",
13241+
kRdsTypeUrl, kDefaultRouteConfigurationName, "1",
1324313242
UnpackRouteConfiguration(EqRouteConfiguration(
1324413243
kDefaultRouteConfigurationName, kDefaultClusterName)),
1324513244
ClientResourceStatus::NACKED,
@@ -13249,7 +13248,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpRouteError) {
1324913248
ok = ::testing::Value(
1325013249
csds_response.config(0).generic_xds_configs(),
1325113250
::testing::Contains(EqGenericXdsConfig(
13252-
kLdsTypeUrl, kServerName, /*version_info=*/"1",
13251+
kLdsTypeUrl, kServerName, "1",
1325313252
UnpackListener(EqListener(
1325413253
kServerName, EqNoRdsHCM(kDefaultRouteConfigurationName,
1325513254
kDefaultClusterName))),
@@ -13283,7 +13282,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpClusterError) {
1328313282
bool ok = ::testing::Value(
1328413283
csds_response.config(0).generic_xds_configs(),
1328513284
::testing::Contains(EqGenericXdsConfig(
13286-
kCdsTypeUrl, kDefaultClusterName, /*version_info=*/"1",
13285+
kCdsTypeUrl, kDefaultClusterName, "1",
1328713286
UnpackCluster(EqCluster(kDefaultClusterName)),
1328813287
ClientResourceStatus::NACKED,
1328913288
EqUpdateFailureState(
@@ -13318,7 +13317,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpEndpointError) {
1331813317
bool ok = ::testing::Value(
1331913318
csds_response.config(0).generic_xds_configs(),
1332013319
::testing::Contains(EqGenericXdsConfig(
13321-
kEdsTypeUrl, kDefaultEdsServiceName, /*version_info=*/"1",
13320+
kEdsTypeUrl, kDefaultEdsServiceName, "1",
1332213321
UnpackClusterLoadAssignment(EqClusterLoadAssignment(
1332313322
kDefaultEdsServiceName, backends_[0]->port(),
1332413323
kDefaultLocalityWeight)),
@@ -13340,11 +13339,10 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpListenerRequested) {
1334013339
.set_rpc_options(RpcOptions().set_timeout_ms(kTimeoutMillisecond))
1334113340
.set_expected_error_code(StatusCode::DEADLINE_EXCEEDED));
1334213341
auto csds_response = FetchCsdsResponse();
13343-
EXPECT_THAT(
13344-
csds_response.config(0).generic_xds_configs(),
13345-
::testing::Contains(EqGenericXdsConfig(
13346-
kLdsTypeUrl, kServerName, /*version_info=*/::testing::_, ::testing::_,
13347-
ClientResourceStatus::REQUESTED, /*error_state=*/::testing::_)));
13342+
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
13343+
::testing::Contains(EqGenericXdsConfig(
13344+
kLdsTypeUrl, kServerName, ::testing::_, ::testing::_,
13345+
ClientResourceStatus::REQUESTED, ::testing::_)));
1334813346
}
1334913347

1335013348
TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpClusterRequested) {
@@ -13374,13 +13372,11 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpClusterRequested) {
1337413372
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
1337513373
::testing::AllOf(
1337613374
::testing::Contains(EqGenericXdsConfig(
13377-
kCdsTypeUrl, kClusterName1, /*version_info=*/::testing::_,
13378-
::testing::_, ClientResourceStatus::REQUESTED,
13379-
/*error_state=*/::testing::_)),
13375+
kCdsTypeUrl, kClusterName1, ::testing::_, ::testing::_,
13376+
ClientResourceStatus::REQUESTED, ::testing::_)),
1338013377
::testing::Contains(EqGenericXdsConfig(
13381-
kCdsTypeUrl, kClusterName2, /*version_info=*/::testing::_,
13382-
::testing::_, ClientResourceStatus::REQUESTED,
13383-
/*error_state=*/::testing::_))));
13378+
kCdsTypeUrl, kClusterName2, ::testing::_, ::testing::_,
13379+
ClientResourceStatus::REQUESTED, ::testing::_))));
1338413380
}
1338513381

1338613382
class CsdsShortAdsTimeoutTest : public ClientStatusDiscoveryServiceTest {
@@ -13399,11 +13395,10 @@ TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpListenerDoesNotExist) {
1339913395
.set_rpc_options(RpcOptions().set_timeout_ms(kTimeoutMillisecond))
1340013396
.set_expected_error_code(grpc::StatusCode::UNAVAILABLE));
1340113397
auto csds_response = FetchCsdsResponse();
13402-
EXPECT_THAT(
13403-
csds_response.config(0).generic_xds_configs(),
13404-
::testing::Contains(EqGenericXdsConfig(
13405-
kLdsTypeUrl, kServerName, /*version_info=*/::testing::_, ::testing::_,
13406-
ClientResourceStatus::DOES_NOT_EXIST, /*error_state=*/::testing::_)));
13398+
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
13399+
::testing::Contains(EqGenericXdsConfig(
13400+
kLdsTypeUrl, kServerName, ::testing::_, ::testing::_,
13401+
ClientResourceStatus::DOES_NOT_EXIST, ::testing::_)));
1340713402
}
1340813403

1340913404
TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpRouteConfigDoesNotExist) {
@@ -13419,9 +13414,8 @@ TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpRouteConfigDoesNotExist) {
1341913414
EXPECT_THAT(
1342013415
csds_response.config(0).generic_xds_configs(),
1342113416
::testing::Contains(EqGenericXdsConfig(
13422-
kRdsTypeUrl, kDefaultRouteConfigurationName,
13423-
/*version_info=*/::testing::_, ::testing::_,
13424-
ClientResourceStatus::DOES_NOT_EXIST, /*error_state=*/::testing::_)));
13417+
kRdsTypeUrl, kDefaultRouteConfigurationName, ::testing::_,
13418+
::testing::_, ClientResourceStatus::DOES_NOT_EXIST, ::testing::_)));
1342513419
}
1342613420

1342713421
TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpClusterDoesNotExist) {
@@ -13432,12 +13426,10 @@ TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpClusterDoesNotExist) {
1343213426
.set_rpc_options(RpcOptions().set_timeout_ms(kTimeoutMillisecond))
1343313427
.set_expected_error_code(grpc::StatusCode::UNAVAILABLE));
1343413428
auto csds_response = FetchCsdsResponse();
13435-
EXPECT_THAT(
13436-
csds_response.config(0).generic_xds_configs(),
13437-
::testing::Contains(EqGenericXdsConfig(
13438-
kCdsTypeUrl, kDefaultClusterName, /*version_info=*/::testing::_,
13439-
::testing::_, ClientResourceStatus::DOES_NOT_EXIST,
13440-
/*error_state=*/::testing::_)));
13429+
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
13430+
::testing::Contains(EqGenericXdsConfig(
13431+
kCdsTypeUrl, kDefaultClusterName, ::testing::_, ::testing::_,
13432+
ClientResourceStatus::DOES_NOT_EXIST, ::testing::_)));
1344113433
}
1344213434

1344313435
TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpEndpointDoesNotExist) {
@@ -13448,12 +13440,11 @@ TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpEndpointDoesNotExist) {
1344813440
.set_rpc_options(RpcOptions().set_timeout_ms(kTimeoutMillisecond))
1344913441
.set_expected_error_code(grpc::StatusCode::UNAVAILABLE));
1345013442
auto csds_response = FetchCsdsResponse();
13451-
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
13452-
::testing::Contains(EqGenericXdsConfig(
13453-
kEdsTypeUrl, kDefaultEdsServiceName,
13454-
/*version_info=*/::testing::_, ::testing::_,
13455-
ClientResourceStatus::DOES_NOT_EXIST,
13456-
/*error_state=*/::testing::_)));
13443+
EXPECT_THAT(
13444+
csds_response.config(0).generic_xds_configs(),
13445+
::testing::Contains(EqGenericXdsConfig(
13446+
kEdsTypeUrl, kDefaultEdsServiceName, ::testing::_, ::testing::_,
13447+
ClientResourceStatus::DOES_NOT_EXIST, ::testing::_)));
1345713448
}
1345813449

1345913450
#endif // DISABLED_XDS_PROTO_IN_CC

test/cpp/util/grpc_tool_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,6 @@ TEST_F(GrpcToolTest, ConfiguringDefaultServiceConfig) {
13491349
int main(int argc, char** argv) {
13501350
grpc::testing::TestEnvironment env(argc, argv);
13511351
::testing::InitGoogleTest(&argc, argv);
1352-
GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
1352+
GTEST_FLAG_SET(death_test_style, "threadsafe");
13531353
return RUN_ALL_TESTS();
13541354
}

test/cpp/util/test_config.h

-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
#ifndef GRPC_TEST_CPP_UTIL_TEST_CONFIG_H
2020
#define GRPC_TEST_CPP_UTIL_TEST_CONFIG_H
2121

22-
#ifndef GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE
23-
#define GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE(style) \
24-
::testing::FLAGS_gtest_death_test_style = style
25-
#endif // GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE
26-
2722
namespace grpc {
2823
namespace testing {
2924

third_party/googletest

Submodule googletest updated 240 files

tools/run_tests/sanity/check_submodules.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ third_party/boringssl-with-bazel b9232f9e27e5668bc0414879dcdedb2a59ea75f2
3232
third_party/cares/cares 6654436a307a5a686b008c1d4c93b0085da6e6d8
3333
third_party/envoy-api ff47e0a4bd03c0580305f9b138cc7937b63f7900
3434
third_party/googleapis 2f9af297c84c55c8b871ba4495e01ade42476c92
35-
third_party/googletest c9ccac7cb7345901884aabf5d1a786cfa6e2f397
35+
third_party/googletest 0e402173c97aea7a00749e825b194bfede4f2e45
3636
third_party/libuv 02a9e1be252b623ee032a3137c0b0c94afbe6809
3737
third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89
3838
third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df

0 commit comments

Comments
 (0)