From 6e5c33c3e26ee1d43e2083034e05ffd0dc105934 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Sat, 30 Jul 2016 02:56:46 -0700 Subject: [PATCH] Don't assert if we're not able to set affinity for some reason --- test/cpp/qps/limit_cores.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpp/qps/limit_cores.cc b/test/cpp/qps/limit_cores.cc index 59ed369067f..b5c222542be 100644 --- a/test/cpp/qps/limit_cores.cc +++ b/test/cpp/qps/limit_cores.cc @@ -68,9 +68,9 @@ int LimitCores(const int* cores, int cores_size) { cores_set++; } } - GPR_ASSERT(sched_setaffinity(0, size, cpup) == 0); + bool affinity_set = (sched_setaffinity(0, size, cpup) == 0); CPU_FREE(cpup); - return cores_set; + return affinity_set ? cores_set : num_cores; } } // namespace testing