[fixit] Scale down large tests (#30673)

We have many tests that create 100 threads or more, and mounting evidence that
this is harmful to our CI environment.

When the original code for many of these tests was written we ran our tests
under run_tests, which had explicit handling for tracking the number of threads
each test needed and making sure that we weren't over subscribing the test
runner. Bazel has no such facility (and the facility in run_tests has since
been removed) and so we need to adjust.

This PR adjusts down a single test and is part of a series so that we can
review and roll back easily if required.
pull/30411/head
Craig Tiller 2 years ago committed by GitHub
parent f133d81714
commit a9d4bc4cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      test/core/client_channel/resolvers/google_c2p_resolver_test.cc

@ -71,7 +71,7 @@ TEST(DestroyGoogleC2pChannelWithActiveConnectStressTest,
kWaitForClientToSendFirstBytes,
grpc_core::testing::FakeUdpAndTcpServer::CloseSocketUponCloseFromPeer);
std::vector<std::unique_ptr<std::thread>> threads;
const int kNumThreads = 100;
const int kNumThreads = 10;
threads.reserve(kNumThreads);
for (int i = 0; i < kNumThreads; i++) {
threads.emplace_back(
@ -90,7 +90,7 @@ TEST(DestroyGoogleC2pChannelWithActiveConnectStressTest,
int port = grpc_pick_unused_port_or_die();
std::string address = absl::StrFormat("[::1]:%d", port);
std::vector<std::unique_ptr<std::thread>> threads;
const int kNumThreads = 100;
const int kNumThreads = 10;
threads.reserve(kNumThreads);
for (int i = 0; i < kNumThreads; i++) {
threads.emplace_back(

Loading…
Cancel
Save