Apply patch to fix hanging test on uniprocessor machines

Resolves: RHEL-86470
This commit is contained in:
Jonathan Wakely 2026-04-21 13:41:35 +01:00
parent 8b99dc5d4e
commit c7d6b92d15
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 8c968ef74bb804200cd25fa6e078d5aabed7a5e6 Mon Sep 17 00:00:00 2001
From: Petter Reinholdtsen <pere@debian.org>
Date: Tue, 31 Mar 2026 10:07:49 +0200
Subject: [PATCH] Adjusted test_lightweight to avoid zero threads in test.
When the hardware only support one core, hardware_concurrency() return 1,
which when deviced by 2 using integer division end up as 0, a useless
number of threads. Instead, ensure it end up as 1, while the other
return values still end up with a sensible number by changing
(i/2) to ((i+1)/2).
This fix is related to #2027.
---
test/common/graph_utils.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/common/graph_utils.h b/test/common/graph_utils.h
index 26a0c0ada0..714a27f79b 100644
--- a/test/common/graph_utils.h
+++ b/test/common/graph_utils.h
@@ -953,7 +953,7 @@ template<typename NodeType>
void test_lightweight(unsigned N) {
test_unlimited_lightweight_execution<NodeType>(N);
test_limited_lightweight_execution<NodeType>(N, tbb::flow::serial);
- test_limited_lightweight_execution<NodeType>(N, (std::min)(std::thread::hardware_concurrency() / 2, N/2));
+ test_limited_lightweight_execution<NodeType>(N, (std::min)((std::thread::hardware_concurrency()+1) / 2, N/2));
test_limited_lightweight_execution_with_throwing_body<NodeType>(N, tbb::flow::serial);
}

View File

@ -5,7 +5,7 @@
Name: tbb
Summary: The Threading Building Blocks library abstracts low-level threading details
Version: 2021.11.0
Release: 7%{?dist}
Release: 8%{?dist}
License: Apache-2.0 AND BSD-3-Clause
URL: http://threadingbuildingblocks.org/
@ -21,6 +21,10 @@ Patch0: tbb-2021-Werror.patch
# Fix code that violates the strict aliasing rules.
Patch1: tbb-2021-strict-aliasing.patch
# https://github.com/uxlfoundation/oneTBB/pull/2033
# https://issues.redhat.com/browse/RHEL-86470
Patch3: tbb-2021-avoid-zero-threads.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: hwloc
@ -187,6 +191,10 @@ ctest --output-on-failure --force-new-ctest-process
%{python3_sitearch}/__pycache__/TBB*
%changelog
* Tue Apr 21 2026 Jonathan Wakely <jwakely@redhat.com> - 2021.11.0-8
- Apply patch to fix hanging test on uniprocessor machines.
Resolves: RHEL-86470
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 2021.11.0-7
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018