Skip to content

Commit 3df11e4

Browse files
author
Petter Reinholdtsen
committed
Fixed conformance_arena_constraints test failure with no NUMA hardware.
On a system without NUMA support, like GNU Hurd, the test would fail like this: [doctest] doctest version is "2.4.12" [doctest] run with "--help" for options =============================================================================== test/conformance/conformance_arena_constraints.cpp:44: TEST CASE: Test NUMA topology traversal correctness test/conformance/conformance_arena_constraints.cpp:54: FATAL ERROR: REQUIRE( pos != numa_nodes_info.end() ) is NOT correct! values: REQUIRE( {?} != {?} ) logged: Wrong, extra or repeated NUMA node index detected. =============================================================================== [doctest] test cases: 5 | 4 passed | 1 failed | 0 skipped [doctest] assertions: 27 | 26 passed | 1 failed | [doctest] Status: FAILURE! With the fix in place, the test succeed. Fixes #2039
1 parent 34b3d4b commit 3df11e4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/conformance/conformance_arena_constraints.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,15 @@ TEST_CASE("Test NUMA topology traversal correctness") {
4747

4848
std::vector<oneapi::tbb::numa_node_id> numa_indexes = oneapi::tbb::info::numa_nodes();
4949
for (const auto& numa_id: numa_indexes) {
50+
// numa_info.index is set to 0 in numa_topology_parsing() if
51+
// no NUMA support is present. No use comparing it with the
52+
// numa_id which is -1 when no NUMA support is present, so
53+
// handle -1 specially.
5054
auto pos = std::find_if(numa_nodes_info.begin(), numa_nodes_info.end(),
51-
[&](const index_info& numa_info){ return numa_info.index == numa_id; }
55+
[&](const index_info& numa_info){
56+
printf("numa_info.index %d == numa_id %d\n", numa_info.index, numa_id);
57+
return -1 == numa_id || numa_info.index == numa_id;
58+
}
5259
);
5360

5461
REQUIRE_MESSAGE(pos != numa_nodes_info.end(), "Wrong, extra or repeated NUMA node index detected.");

0 commit comments

Comments
 (0)