Skip to content

Commit 4dc9df9

Browse files
authored
Merge pull request #1331 from bratpiorka/rrudnick_qemu_fix
Fix checking num of targets in memspace CapacityFilter test
2 parents 93c9ab0 + 44383b4 commit 4dc9df9

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

.github/workflows/reusable_qemu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
if: ${{ inputs.short_run == true }}
9999
run: |
100100
echo "SHORT_RUN=true" >> $GITHUB_ENV
101-
declare -a short_configs=("default.xml" "sock_2_var3.xml" "sock_4_var1_hmat.xml")
101+
declare -a short_configs=("default.xml" "sock_2_var3.xml" "sock_8_var1_hmat.xml")
102102
echo "CONFIG_OPTIONS=${short_configs[@]}" >> $GITHUB_ENV
103103
104104
- name: Set vars if long run

test/memspaces/memspace_numa.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2023-2024 Intel Corporation
1+
// Copyright (C) 2023-2025 Intel Corporation
22
// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -252,8 +252,8 @@ TEST_F(numaNodesCapacityTest, CapacityFilter) {
252252
ret = umfMemspaceFilterByCapacity(hMemspace, filter_size);
253253
ASSERT_EQ(ret, UMF_RESULT_SUCCESS);
254254

255-
ASSERT_EQ(umfMemspaceMemtargetNum(hMemspace), (capacities.size() + 1) / 2);
256-
for (size_t i = 0; i < umfMemspaceMemtargetNum(hMemspace); i++) {
255+
size_t num_filtered = umfMemspaceMemtargetNum(hMemspace);
256+
for (size_t i = 0; i < num_filtered; i++) {
257257
auto hTarget = umfMemspaceMemtargetGet(hMemspace, i);
258258
ASSERT_NE(hTarget, nullptr);
259259
size_t capacity;
@@ -266,6 +266,17 @@ TEST_F(numaNodesCapacityTest, CapacityFilter) {
266266
capacities.erase(it);
267267
}
268268
}
269+
270+
// Number of filtered targets and remaining targets should match the total
271+
// number of targets in the memspace
272+
size_t num_all = umfMemspaceMemtargetNum(umfMemspaceHostAllGet());
273+
ASSERT_EQ(num_filtered + capacities.size(), num_all);
274+
275+
// check that remaining capacities are less than filter_size
276+
for (const auto &capacity : capacities) {
277+
ASSERT_LT(capacity, filter_size);
278+
}
279+
269280
umfMemspaceDestroy(hMemspace);
270281
}
271282

0 commit comments

Comments
 (0)