Skip to content

Commit 68fb9f5

Browse files
committed
Fix OOM test for HOST ALL memspace
Add an access to each allocation so that pages are actually allocated on the selected NUMA nodes.
1 parent 40d919c commit 68fb9f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/memspaces/memspace_host_all.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void getAllocationPolicy(void *ptr, unsigned long maxNodeId, int &mode,
9999
TEST_F(memspaceHostAllProviderTest, memoryPolicyOOM) {
100100
// Arbitrary allocation size, should be big enough to avoid unnecessarily
101101
// prolonging the test execution.
102-
size_t size = SIZE_4M * 128;
102+
size_t size = SIZE_4M * 64;
103103
size_t alignment = 0;
104104
std::vector<void *> allocs;
105105

@@ -112,6 +112,9 @@ TEST_F(memspaceHostAllProviderTest, memoryPolicyOOM) {
112112
break;
113113
}
114114

115+
// Allocate the necessary pages, by accessing the memory at 'ptr'.
116+
*static_cast<int *>(ptr) = 0xC0FFEE;
117+
115118
UT_ASSERTne(ptr, nullptr);
116119
allocs.push_back(ptr);
117120
}

0 commit comments

Comments
 (0)