[fixit] Scale down large tests (#30684)

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/30700/head
Craig Tiller 2 years ago committed by GitHub
parent 15700611b5
commit 07ecb5f85a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      test/core/config/core_configuration_test.cc

@ -53,8 +53,8 @@ TEST(ConfigTest, ThreadedInit) {
std::this_thread::sleep_for(std::chrono::seconds(1)); std::this_thread::sleep_for(std::chrono::seconds(1));
}; };
std::vector<std::thread> threads; std::vector<std::thread> threads;
threads.reserve(64); threads.reserve(10);
for (int i = 0; i < 64; i++) { for (int i = 0; i < 10; i++) {
threads.push_back(std::thread([]() { CoreConfiguration::Get(); })); threads.push_back(std::thread([]() { CoreConfiguration::Get(); }));
} }
for (auto& t : threads) { for (auto& t : threads) {

Loading…
Cancel
Save