aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-05-08 07:23:52 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-05-08 07:23:52 +0000
commit33c964f5fe3d70eb058a072e45889bc0e114d3d6 (patch)
tree9297b715d2e493b510a69e62998852a9b8049e1c
parentf76eaf901dfece9ff4c20168347df8b94c714e89 (diff)
parent775fb0962173f07aeb46c8ae764a35a85e00a3f0 (diff)
downloadbionic-33c964f5fe3d70eb058a072e45889bc0e114d3d6.tar.gz
Snap for 4767765 from 775fb0962173f07aeb46c8ae764a35a85e00a3f0 to pi-release
Change-Id: I5751f0e466bf7ea8abbb09beec054ec5b7e4222d
-rw-r--r--tests/leak_test.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/tests/leak_test.cpp b/tests/leak_test.cpp
index de0886917..1fa9e564d 100644
--- a/tests/leak_test.cpp
+++ b/tests/leak_test.cpp
@@ -107,10 +107,17 @@ std::ostream& operator<<(std::ostream& os, const LeakChecker& lc) {
// http://b/36045112
TEST(pthread_leak, join) {
LeakChecker lc;
- for (int i = 0; i < 100; ++i) {
- pthread_t thread;
- ASSERT_EQ(0, pthread_create(&thread, nullptr, [](void*) -> void* { return nullptr; }, nullptr));
- ASSERT_EQ(0, pthread_join(thread, nullptr));
+
+ for (size_t pass = 0; pass < 2; ++pass) {
+ for (int i = 0; i < 100; ++i) {
+ pthread_t thread;
+ ASSERT_EQ(0, pthread_create(&thread, nullptr, [](void*) -> void* { return nullptr; }, nullptr));
+ ASSERT_EQ(0, pthread_join(thread, nullptr));
+ }
+
+ // A native bridge implementation might need a warm up pass to reach a steady state.
+ // http://b/37920774.
+ if (pass == 0) lc.Reset();
}
}
@@ -145,9 +152,8 @@ TEST(pthread_leak, detach) {
WaitUntilAllExited(tids, arraysize(tids));
- // houdini keeps a thread pool, so we ignore the first pass while the
- // pool fills, but then on the second pass require that the "pool" isn't
- // actually an unbounded leak. https://issuetracker.google.com/37920774.
+ // A native bridge implementation might need a warm up pass to reach a steady state.
+ // http://b/37920774.
if (pass == 0) lc.Reset();
}
}