Fixes #58283
When running in a docker container you can have fewer cores assigned
to you than get_nrpoc would suggest.
Since the test just wants to know that interception worked, allow
any result > 0 and <= the global core count.
Differential D135677
[compiler-rt] Relax pthread_getaffinity test to account for cgroups/docker DavidSpickett on Oct 11 2022, 7:45 AM. Authored by
Details Fixes #58283 When running in a docker container you can have fewer cores assigned Since the test just wants to know that interception worked, allow
Diff Detail
Event TimelineComment Actions For https://github.com/llvm/llvm-project/issues/58283 Does this seem reasonable? Perhaps there is a way to call the real pthread_getaffinity_np in the test instead, but I wasn't sure how that would be done. Comment Actions I wonder whether we should just relax the test, instead of introducing a lit feature based on if os.cpu_count() != len(os.sched_getaffinity(0)). I can confirm that the test also fails if I restrict affinity with something like numactl -C 0-3 /tmp/RelA/bin/llvm-lit -a /tmp/RelA/projects/compiler-rt/test/sanitizer_common/asan-x86_64-Linux/Linux/pthread_getaffinity_np.cpp
Comment Actions LGTM.
|
Relaxing the test looks better to me