Fix race in method jitting for 597-deopt-invoke-stub
597-deopt-invoke-stub tests deopting quick-to-interpreter bridge.
It requires a compiled method to call into an uncompiled method.
However the method that's not supposed to be compiled gets compiled
occassionally. It's because that AddSamples() is called twice for the
method, one for Jit::NotifyInterpreterToCompiledCodeTransition()
and one for Jit::MethodEntered(). This triggers the jit
compilation of the method, and when compilation happens very fast,
jit->CanInvokeCompiledCode() picks up the freshly compiled code.
The change bumps up the compilation threshold to 10000 in the run script,
instead of the default value of 2 under debug build.
Also exclude speed profile testing configuration for this test. It
generates random profile which may compile the method also.
Test: m -j32 test-art-host-run-test
Bug: 66936353
Change-Id: I119b02a39b8c1b0619fc9fd0ccc51fa034099f7f
diff --git a/test/597-deopt-invoke-stub/run b/test/597-deopt-invoke-stub/run
index bc04498..53b7c4c 100644
--- a/test/597-deopt-invoke-stub/run
+++ b/test/597-deopt-invoke-stub/run
@@ -14,5 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# We want to run in debuggable mode and compiled.
-exec ${RUN} --jit -Xcompiler-option --debuggable "${@}"
+# In order to test deoptimizing at quick-to-interpreter bridge,
+# we want to run in debuggable mode with jit compilation.
+# We also bump up the jit threshold to 10 to make sure that the method
+# that should be interpreted is not compiled.
+exec ${RUN} --jit --runtime-option -Xjitthreshold:10000 -Xcompiler-option --debuggable "${@}"
diff --git a/test/knownfailures.json b/test/knownfailures.json
index df24c7d..d59b374 100644
--- a/test/knownfailures.json
+++ b/test/knownfailures.json
@@ -231,7 +231,7 @@
},
{
"tests": "597-deopt-invoke-stub",
- "variant": "interp-ac | interpreter | optimizing | trace | stream",
+ "variant": "speed-profile | interp-ac | interpreter | optimizing | trace | stream",
"description": ["This test expects JIT compilation and no AOT for",
"testing deoptimizing at quick-to-interpreter bridge."]
},