Reduce file descriptor limit for 151-OpenFileLimit.
Under the assumption it is failing on host in some cases because it
takes too long to reach the limit. This change reduces the time it
takes to run the test from 50s down to 2s.
Test: time ./test/run-test --host --prebuild --interpreter --relocate --runtime-option -Xcheck:jni --64 151-OpenFileLimit
Bug: 32302133
Change-Id: I833e3a7aa2164a3cee2744f8e8c7e02365844aa0
diff --git a/test/151-OpenFileLimit/run b/test/151-OpenFileLimit/run
new file mode 100755
index 0000000..5c83fd0
--- /dev/null
+++ b/test/151-OpenFileLimit/run
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+flags="$@"
+
+# Reduce the file descriptor limit so the test will reach the limit sooner.
+ulimit -n 512
+${RUN} ${flags}