]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Reduce iterations in PSTL test for Debug Mode
authorJonathan Wakely <jwakely@redhat.com>
Sun, 17 May 2026 18:27:11 +0000 (19:27 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 18 May 2026 15:42:16 +0000 (16:42 +0100)
This test often times out, especially on machines with a large number of
cores when the tests are run with a lot of parallel jobs. I suspect that
TBB creates a lot of threads due to std::hardware_concurrency() being a
large number, but because most cores are already busy running other
tests (due to `make -jN check` with large N) the system gets
oversubscribed. In Debug Mode, the testcase runs much slower, and often
times out.

It's probably fine to just test with fewer iterations when Debug Mode is
active.

libstdc++-v3/ChangeLog:

* testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc:
Reduce iterations for debug mode.

libstdc++-v3/testsuite/25_algorithms/pstl/alg_sorting/minmax_element.cc

index e4bd435d19263f2deb2493ef4aab6d0de799a879..51bdeaa96a139279fcda66c29865e0c327655bdf 100644 (file)
@@ -189,7 +189,11 @@ int
 main()
 {
     using TestUtils::float64_t;
+#ifndef _GLIBCXX_DEBUG
     const std::size_t N = 100000;
+#else
+    const std::size_t N = 10000;
+#endif
 
     for (std::size_t n = 0; n < N; n = n < 16 ? n + 1 : size_t(3.14159 * n))
     {