summaryrefslogtreecommitdiff
path: root/test/004-NativeAllocations/src-art/Main.java
AgeCommit message (Collapse)Author
2023-11-21More 004-NativeAllocations failure output Hans Boehm
Produce more debugging output for a failing test. As part of that, we allocate additional finalizable objects, and print how many of them were finalized. This should allow us to tell if there were young GCs, but the PhantomReference was promoted. Also print whether the reference was enqueued after explicitly triggering a GC. Mark various allocation functions noinline to make sure that we don't accidentally keep the allocated objects live. I don't really expect this to be the issue, but ... Increase the delay after we fail until we recheck the reference. Bug: 123921229 Test: Inspect message when PhantomReference is kept live. Change-Id: Ic5cc9aba3ed383def3174ef0fc1c6b4ed61678a1
2023-06-09NativeAllocation tweaks Hans Boehm
Define kCheckImmediatelyThreshold in terms of kNotifyNativeInterval. We previously raised kNotifyNativeInterval without adjusting it, making it possible to go for much longer periods with checking whether we should GC. This effectively reduces kCheckImmediatelyThreshold, by about a factor of 2 in production, and more on host. This is unlikely to fix the failures. Have 004-NativeAllocations produce much more detailed output on failure. MUST_SLEEP to keep Lint happy. Bug: 123921229 Test: TreeHugger Change-Id: Ibe61ea16be8a5f25ec241f682ef3b4958a50116f
2019-03-29Add FinalizerTimeoutMs argument, and respect it Hans Boehm
Add -XX:FinalizerTimeoutMs commandline argument, and make it available for libcore. Add 1336-short-finalizer-timeout to test it. Blacklist it for the cases in which 030-bad-finalizers was known not to work, since it's largely a clone. Disable it for gcstress, since timeout margins are tight. Increase timeout in 030-bad-finalizers due to gcstress issues. Use the result in 004-NativeAllocations and 030-bad-finalizers to avoid timeouts. Make 004-NativeAllocations more proactive in avoiding timeout. This is intended as a replacement for aosp/836642 . Bug: 129350738 Bug: 68792448 Test: Boot AOSP, TreeHugger Change-Id: I9aef9c9bacb7e8d851bd2c879ed9fb5b596abc60
2018-01-22Reduce flakiness of 004-NativeAllocations test. Richard Uhler
Under a GSS configuration, calls to registerNativeAllocation trigger blocking GC instead of concurrent GC, which means the main thread in the test can end up holding on to deadlockLock for longer than the finalizer timeout. The fix is to reduce the calls to registerNativeAlloation required to trigger the deadlock scenario. Bug: 68792448 Test: ./test/testrunner/testrunner.py -b -t 004-NativeAllocations Test: Verify test catches deadlock case on buggy versions of art. Change-Id: Ide417de7a5cad593afd2877054f88588b7a32be3
2018-01-16Revise 004-NativeAllocations test. Richard Uhler
Simplifies test logic for testing that RegisterNativeAllocation triggers GC and doesn't deadlock. Removes the test that RegisterNativeAllocation bounds the maximum allocated native bytes, because we no longer wish to provide a guarantee of that kind. Test: ./test/testrunner/testrunner.py -b -t 004-NativeAllocations --host Test: Verify the test fails if RegisterNativeAllocation does nothing. Test: Verify the test fails if kNativeAllocationFinalizeTimeout is 0. Bug: 68792448 Bug: 70831911 Change-Id: I3f6625869a89976e22918e2bca79c87f54aa9596
2017-06-21test: enable javac/dx to import libcore on the bootclasspath Igor Murashkin
Fixes 12 tests with javac/dx. Previously, javac with the default bootclasspath (unspecified) was used, meaning that it would usually pickup rt.jar from a developer's JDK system install. With javac-helper.sh, libcore is used for the javac -bootclasspath, enabling art tests to load libcore-specific packages such as libcore or dalvik (in particular, it uses the output of art/tools/bootjars.sh which calculates the correct bootclasspath from the build artifacts). To get libcore on the bootclasspath, source files must be placed in a 'art/test/$TESTNAME/src-art' directory. Otherwise the old behavior is kept to encourage tests to be cross-platform compatible. The minimal set of tests that relied on 'import dalvik/import libcore' had their src directories renamed to src-art, and are now building successfully. Test: ANDROID_COMPILE_WITH_JACK=false art/test.py Bug: 36902714 Change-Id: Iafd245de9e04c312c5ac107897e34d7b97191726