Skip to content

Drop getconf check in TestGetPresent#16

Merged
tklauser merged 1 commit intomasterfrom
test-present-drop-getconf
Aug 16, 2021
Merged

Drop getconf check in TestGetPresent#16
tklauser merged 1 commit intomasterfrom
test-present-drop-getconf

Conversation

@tklauser
Copy link
Owner

It seems the assumption that getconf _NPROCESSORS_CONF returns
the number of CPUs in /sys/devices/system/cpu/present is not always
true on all systems.

Inspecting the code of glibc's getconf implementation it seems the value
returned by getconf _NPROCESSORS_CONF is the total number of cpuN
directories found in /sys/devices/system/cpu while
numcpus.GetPresent reads /sys/devices/system/cpu/present. Thus, drop
the check to avoid failing tests where this might not be true (such as
on some ppc64 systems.

Fixes #15

It seems the assumption that `getconf _NPROCESSORS_CONF` returns
the number of CPUs in `/sys/devices/system/cpu/present` is not always
true on all systems.

Inspecting the code of glibc's getconf implementation it seems the value
returned by `getconf _NPROCESSORS_CONF` is the total number of `cpuN`
directories found in `/sys/devices/system/cpu` while
`numcpus.GetPresent` reads `/sys/devices/system/cpu/present`. Thus, drop
the check to avoid failing tests where this might not be true (such as
on some ppc64 systems.

Fixes #15
@tklauser tklauser merged commit cebb4e9 into master Aug 16, 2021
@tklauser tklauser deleted the test-present-drop-getconf branch August 16, 2021 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests fail on ppc64

1 participant