ART: Relax java_vm_ext test
Bionic gives more than the requested stack size in some cases, see
change-id I7037ac8273ebe54dd19b1561c7a376819049124c. In that case,
attaching a thread with STACK_MIN may actually succeed.
Bug: 18908062
Change-Id: Ibb3f5c7a7399c01ec2032a133896cf91327370ed
diff --git a/runtime/java_vm_ext_test.cc b/runtime/java_vm_ext_test.cc
index 60c6a5c..2cbfa81 100644
--- a/runtime/java_vm_ext_test.cc
+++ b/runtime/java_vm_ext_test.cc
@@ -69,7 +69,12 @@
} else {
ok = vms_buf[0]->AttachCurrentThreadAsDaemon(&env, nullptr);
}
- EXPECT_EQ(gSmallStack ? JNI_ERR : JNI_OK, ok);
+ // TODO: Find a way to test with exact SMALL_STACK value, for which we would bail. The pthreads
+ // spec says that the stack size argument is a lower bound, and bionic currently gives us
+ // a chunk more on arm64.
+ if (!gSmallStack) {
+ EXPECT_EQ(JNI_OK, ok);
+ }
if (ok == JNI_OK) {
ok = vms_buf[0]->DetachCurrentThread();
EXPECT_EQ(JNI_OK, ok);