Stop CpuSet.NodeSetsAreNonEmpty assuming every NUMA node has CPUs - #86
Merged
Merged
Conversation
The test asserted that every NUMA node reports at least one CPU. That is not true in general: memory-only nodes (CXL-attached memory, persistent memory) and nodes whose CPUs are all offline both report an empty cpulist. On such a host the test fails with "NUMA node 1 has no CPUs" while CpuSet is reporting the topology entirely correctly. Sum CPUs across nodes and assert the total is positive, which is the property actually worth holding. The stronger claim the test was reaching for -- that the node sets partition all() -- is already covered by AllSetCoversAllNodeSets.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
=======================================
+ Coverage 92.6% 93.0% +0.3%
=======================================
Files 64 64
Lines 4990 4990
Branches 678 682 +4
=======================================
+ Hits 4625 4643 +18
+ Misses 365 347 -18 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #89.
The test asserts that every NUMA node reports at least one CPU:
That is not true in general. A NUMA node with no CPUs is legal, and at least two
common cases produce one: memory-only nodes (CXL-attached memory, persistent
memory) and nodes whose CPUs have all been taken offline. Both report an empty
cpulist.
On such a host the test fails with
NUMA node 1 has no CPUswhileCpuSetisreporting the topology entirely correctly — the failure is in the test's
assumption, not the library.
This sums across nodes and asserts the total is positive, which is the property
actually worth holding: that node enumeration finds CPUs somewhere. The
stronger claim the test appears to be reaching for, that the node sets partition
all(), is already covered byAllSetCoversAllNodeSets.