Skip pthread.pthread_create__mmap_failures with native_bridge
The test reserves all memory but the minimum required to create a
thread. However, after the thread is created, native_bridge needs more
memory to translate and run the thread function.
This might be prevented by native_bridge preallocating a memory buffer
to be used for translation. But, first, this complication seems to be
needed just for this kind of tests, and, second, it is pretty flaky
regarding changes both in native_bridge and bionic.
Looks better to disable this test with native_bridge.
Bug: 67745607
Bug: 148608153
Bug: 157394871
Test: bionic-unit-tests --gtest_filter=pthread.pthread_create__mmap_failures
Change-Id: I42ce2b5a01a7d9f10d952a5fc7b75d51fa89072a
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index d825738..851b86f 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -2821,6 +2821,9 @@
}
TEST(pthread, pthread_create__mmap_failures) {
+ // After thread is successfully created, native_bridge might need more memory to run it.
+ SKIP_WITH_NATIVE_BRIDGE;
+
pthread_attr_t attr;
ASSERT_EQ(0, pthread_attr_init(&attr));
ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED));