aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2020-01-16 18:45:39 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-01-16 18:45:39 +0000
commit4c7799f873fbc719ce255cbff0afd6575075c88b (patch)
treea946897f9b920de4d9add5d3be6b7f5f5490f5d1
parentebc58fd03da739bd2d3700ed964f16d9cd103a44 (diff)
parent1b13299bc39000dc1c1a2849987e83c2eda9e8b0 (diff)
downloadbionic-4c7799f873fbc719ce255cbff0afd6575075c88b.tar.gz
-rw-r--r--tests/leak_test.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/leak_test.cpp b/tests/leak_test.cpp
index 600520959..fc72c4589 100644
--- a/tests/leak_test.cpp
+++ b/tests/leak_test.cpp
@@ -126,10 +126,9 @@ TEST(pthread_leak, detach) {
LeakChecker lc;
constexpr int kThreadCount = 100;
- // Devices with low power cores/low number of cores can not finish test in time hence decreasing
- // threads count to 90.
- // http://b/129924384.
- int threads_count = (sysconf(_SC_NPROCESSORS_CONF) > 2) ? kThreadCount : (kThreadCount - 10);
+ // Ancient devices with only 2 cores need a lower limit.
+ // http://b/129924384 and https://issuetracker.google.com/142210680.
+ int threads_count = (sysconf(_SC_NPROCESSORS_CONF) > 2) ? kThreadCount : (kThreadCount - 50);
for (size_t pass = 0; pass < 1; ++pass) {
struct thread_data { pthread_barrier_t* barrier; pid_t* tid; } threads[kThreadCount] = {};
@@ -155,7 +154,7 @@ TEST(pthread_leak, detach) {
pthread_barrier_wait(&barrier);
ASSERT_EQ(pthread_barrier_destroy(&barrier), 0);
- WaitUntilAllExited(tids, arraysize(tids));
+ WaitUntilAllExited(tids, threads_count);
// A native bridge implementation might need a warm up pass to reach a steady state.
// http://b/37920774.