From 15700611b592792b494c84ed19595a4f7d8330a8 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 22 Aug 2022 10:51:54 -0700 Subject: [PATCH] [fixit] Scale down large tests (#30686) 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. --- test/core/gprpp/single_set_ptr_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/core/gprpp/single_set_ptr_test.cc b/test/core/gprpp/single_set_ptr_test.cc index a9410f030c7..88f3a092b46 100644 --- a/test/core/gprpp/single_set_ptr_test.cc +++ b/test/core/gprpp/single_set_ptr_test.cc @@ -45,8 +45,8 @@ TEST(SingleSetPtrTest, CanReset) { TEST(SingleSetPtrTest, LotsOfSetters) { SingleSetPtr p; std::vector threads; - threads.reserve(100); - for (int i = 0; i < 100; i++) { + threads.reserve(10); + for (int i = 0; i < 10; i++) { threads.emplace_back([&p, i]() { p.Set(new int(i)); }); } for (auto& t : threads) {