Increase time to set allocation limit.
Under some circumstances, it's possible to fail the enable allocation
limit android_mallopt call. Increase the total allowed time for the
function to complete.
In addition, if the enable fails, allow another limit call to succeed
in the future.
Finally, change the limit test to use _exit instead of exit.
Bug: 291672185
Test: Ran limit test thousands of times.
Test: Forced the limit to fail and verified the second call passes.
Change-Id: I0948e6fd97231a7538b9b82b76f0a207386681b1
diff --git a/tests/malloc_test.cpp b/tests/malloc_test.cpp
index 2dbc680..776643d 100644
--- a/tests/malloc_test.cpp
+++ b/tests/malloc_test.cpp
@@ -1384,7 +1384,7 @@
threads[i]->join();
}
ASSERT_EQ(1U, num_successful) << "Only one thread should be able to set the limit.";
- exit(0);
+ _exit(0);
}
#endif