From 1864f7388e2d8448569231ab46a1c4d6ec203a96 Mon Sep 17 00:00:00 2001 From: "machenbach@chromium.org" Date: Tue, 21 Jan 2014 12:41:25 +0000 Subject: [PATCH] Add infrastructure for skipping tests in GC stress mode. Also move the GC stress configuration from the buildbot to the test runner. BUG= R=jkummerow@chromium.org, mvstanton@chromium.org Review URL: https://codereview.chromium.org/141653008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18708 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/mjsunit/allocation-site-info.js | 5 ----- test/mjsunit/array-constructor-feedback.js | 5 ----- test/mjsunit/array-feedback.js | 5 ----- test/mjsunit/array-literal-feedback.js | 5 ----- test/mjsunit/d8-performance-now.js | 5 ----- test/mjsunit/elements-kind.js | 3 +-- test/mjsunit/fast-prototype.js | 5 ----- test/mjsunit/mjsunit.status | 22 ++++++++++++++++------ test/mjsunit/opt-elements-kind.js | 5 ----- test/mjsunit/osr-elements-kind.js | 5 ----- test/mjsunit/regress/regress-165637.js | 4 ---- tools/run-deopt-fuzzer.py | 7 ++++--- tools/run-tests.py | 19 ++++++++++++++++--- 13 files changed, 37 insertions(+), 58 deletions(-) diff --git a/test/mjsunit/allocation-site-info.js b/test/mjsunit/allocation-site-info.js index 7885608..cd086d3 100644 --- a/test/mjsunit/allocation-site-info.js +++ b/test/mjsunit/allocation-site-info.js @@ -35,11 +35,6 @@ // in this test case. Depending on whether smi-only arrays are actually // enabled, this test takes the appropriate code path to check smi-only arrays. -// Reset the GC stress mode to be off. Needed because AllocationMementos only -// live for one gc, so a gc that happens in certain fragile areas of the test -// can break assumptions. -%SetFlags("--gc-interval=-1") - // support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); support_smi_only_arrays = true; diff --git a/test/mjsunit/array-constructor-feedback.js b/test/mjsunit/array-constructor-feedback.js index 7d6e08e..7cd421b 100644 --- a/test/mjsunit/array-constructor-feedback.js +++ b/test/mjsunit/array-constructor-feedback.js @@ -35,11 +35,6 @@ // in this test case. Depending on whether smi-only arrays are actually // enabled, this test takes the appropriate code path to check smi-only arrays. -// Reset the GC stress mode to be off. Needed because AllocationMementos only -// live for one gc, so a gc that happens in certain fragile areas of the test -// can break assumptions. -%SetFlags("--gc-interval=-1") - // support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); support_smi_only_arrays = true; diff --git a/test/mjsunit/array-feedback.js b/test/mjsunit/array-feedback.js index 0471f65..4129be1 100644 --- a/test/mjsunit/array-feedback.js +++ b/test/mjsunit/array-feedback.js @@ -35,11 +35,6 @@ // in this test case. Depending on whether smi-only arrays are actually // enabled, this test takes the appropriate code path to check smi-only arrays. -// Reset the GC stress mode to be off. Needed because AllocationMementos only -// live for one gc, so a gc that happens in certain fragile areas of the test -// can break assumptions. -%SetFlags("--gc-interval=-1") - // support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); support_smi_only_arrays = true; diff --git a/test/mjsunit/array-literal-feedback.js b/test/mjsunit/array-literal-feedback.js index c80040b..cfda0f6 100644 --- a/test/mjsunit/array-literal-feedback.js +++ b/test/mjsunit/array-literal-feedback.js @@ -35,11 +35,6 @@ // in this test case. Depending on whether smi-only arrays are actually // enabled, this test takes the appropriate code path to check smi-only arrays. -// Reset the GC stress mode to be off. Needed because AllocationMementos only -// live for one gc, so a gc that happens in certain fragile areas of the test -// can break assumptions. -%SetFlags("--gc-interval=-1") - // support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); support_smi_only_arrays = true; diff --git a/test/mjsunit/d8-performance-now.js b/test/mjsunit/d8-performance-now.js index 13eb1d3..3e5485e 100644 --- a/test/mjsunit/d8-performance-now.js +++ b/test/mjsunit/d8-performance-now.js @@ -30,11 +30,6 @@ // Test the performance.now() function of d8. This test only makes sense with // d8. -// Don't run this test in gc stress mode. Time differences may be long -// due to garbage collections. -%SetFlags("--gc-interval=-1"); -%SetFlags("--nostress-compaction"); - if (this.performance && performance.now) { (function run() { var start_test = performance.now(); diff --git a/test/mjsunit/elements-kind.js b/test/mjsunit/elements-kind.js index b02af65..d16ddca 100644 --- a/test/mjsunit/elements-kind.js +++ b/test/mjsunit/elements-kind.js @@ -25,8 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc -// Flags: --nostress-opt --nostress-compaction --gc-interval=-1 +// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc --nostress-opt // Test element kind of objects. // Since --smi-only-arrays affects builtins, its default setting at compile diff --git a/test/mjsunit/fast-prototype.js b/test/mjsunit/fast-prototype.js index a86b0ea..cdcc1a9 100644 --- a/test/mjsunit/fast-prototype.js +++ b/test/mjsunit/fast-prototype.js @@ -26,11 +26,6 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax --expose-gc - -// TODO(mstarzinger): This test does not succeed when GCs happen in -// between prototype transitions, we disable GC stress for now. -%SetFlags("--gc-interval=-1") - // Flags: --noincremental-marking // Check that objects that are used for prototypes are in the fast mode. diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status index c28c595..2669d0f 100644 --- a/test/mjsunit/mjsunit.status +++ b/test/mjsunit/mjsunit.status @@ -104,15 +104,25 @@ # Tests verifying CHECK and ASSERT. 'verify-check-false': [FAIL, NO_VARIANTS], 'verify-assert-false': [NO_VARIANTS, ['mode == release', PASS], ['mode == debug', FAIL]], - - # TODO(machenbach): Temporarily marked as flaky until there is infrastructure - # to disable these tests on GC stress. - 'elements-kind': [PASS, ['mode == debug and system == linux', FLAKY]], - 'osr-elements-kind': [PASS, ['mode == debug and system == linux', FLAKY]], - 'array-literal-feedback': [PASS, ['mode == debug and system == linux', FLAKY]], }], # ALWAYS ############################################################################## +['gc_stress == True', { + # Skip tests not suitable for GC stress. + 'allocation-site-info': [SKIP], + 'array-constructor-feedback': [SKIP], + 'array-feedback': [SKIP], + 'array-literal-feedback': [SKIP], + 'd8-performance-now': [SKIP], + 'elements-kind': [SKIP], + 'fast-prototype': [SKIP], + 'opt-elements-kind': [SKIP], + 'osr-elements-kind': [SKIP], + 'regress/regress-165637': [SKIP], + 'regress/regress-2249': [SKIP], +}], # 'gc_stress == True' + +############################################################################## ['arch == arm or arch == android_arm', { # Slow tests which times out in debug mode. diff --git a/test/mjsunit/opt-elements-kind.js b/test/mjsunit/opt-elements-kind.js index a7811c8..f26bb42 100644 --- a/test/mjsunit/opt-elements-kind.js +++ b/test/mjsunit/opt-elements-kind.js @@ -39,11 +39,6 @@ // in this test case. Depending on whether smi-only arrays are actually // enabled, this test takes the appropriate code path to check smi-only arrays. -// Reset the GC stress mode to be off. Needed because AllocationMementos only -// live for one gc, so a gc that happens in certain fragile areas of the test -// can break assumptions. -%SetFlags("--gc-interval=-1") - support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); if (support_smi_only_arrays) { diff --git a/test/mjsunit/osr-elements-kind.js b/test/mjsunit/osr-elements-kind.js index af4b5ec..2ad3c43 100644 --- a/test/mjsunit/osr-elements-kind.js +++ b/test/mjsunit/osr-elements-kind.js @@ -39,11 +39,6 @@ // in this test case. Depending on whether smi-only arrays are actually // enabled, this test takes the appropriate code path to check smi-only arrays. -// Reset the GC stress mode to be off. Needed because AllocationMementos only -// live for one gc, so a gc that happens in certain fragile areas of the test -// can break assumptions. -%SetFlags("--gc-interval=-1") - support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); if (support_smi_only_arrays) { diff --git a/test/mjsunit/regress/regress-165637.js b/test/mjsunit/regress/regress-165637.js index 72af528..84c9041 100644 --- a/test/mjsunit/regress/regress-165637.js +++ b/test/mjsunit/regress/regress-165637.js @@ -45,10 +45,6 @@ function do_slices() { return Date.now() - start; } -// Reset the GC stress mode to be off. Needed so that the runtime of this test -// stays within bounds even if we run in GC stress mode. -%SetFlags("--gc-interval=-1 --noforce-marking-deque-overflows"); - // Should never take more than 3 seconds (if the bug is fixed, the test takes // considerably less time than 3 seconds). assertTrue(do_slices() < (3 * 1000)); diff --git a/tools/run-deopt-fuzzer.py b/tools/run-deopt-fuzzer.py index 292cf00..401ae04 100755 --- a/tools/run-deopt-fuzzer.py +++ b/tools/run-deopt-fuzzer.py @@ -363,12 +363,13 @@ def Execute(arch, mode, args, options, suites, workspace): # Find available test suites and read test cases from them. variables = { - "mode": mode, "arch": arch, - "system": utils.GuessOS(), - "isolates": options.isolates, "deopt_fuzzer": True, + "gc_stress": False, + "isolates": options.isolates, + "mode": mode, "no_i18n": False, + "system": utils.GuessOS(), } all_tests = [] num_tests = 0 diff --git a/tools/run-tests.py b/tools/run-tests.py index 15c42d0..e032a55 100755 --- a/tools/run-tests.py +++ b/tools/run-tests.py @@ -68,6 +68,11 @@ MODE_FLAGS = { "release" : ["--nobreak-on-abort", "--nodead-code-elimination", "--nofold-constants"]} +GC_STRESS_FLAGS = ["--gc-interval=500", "--stress-compaction", + "--concurrent-recompilation-queue-length=64", + "--concurrent-recompilation-delay=500", + "--concurrent-recompilation"] + SUPPORTED_ARCHS = ["android_arm", "android_ia32", "arm", @@ -108,6 +113,9 @@ def BuildOptions(): result.add_option("--pass-fail-tests", help="Regard pass|fail tests (run|skip|dontcare)", default="dontcare") + result.add_option("--gc-stress", + help="Switch on GC stress mode", + default=False, action="store_true") result.add_option("--command-prefix", help="Prepended to each shell command used to run a test", default="") @@ -220,6 +228,10 @@ def ProcessOptions(options): options.no_network = True options.command_prefix = shlex.split(options.command_prefix) options.extra_flags = shlex.split(options.extra_flags) + + if options.gc_stress: + options.extra_flags += GC_STRESS_FLAGS + if options.j == 0: options.j = multiprocessing.cpu_count() @@ -373,12 +385,13 @@ def Execute(arch, mode, args, options, suites, workspace): # Find available test suites and read test cases from them. variables = { - "mode": mode, "arch": arch, - "system": utils.GuessOS(), - "isolates": options.isolates, "deopt_fuzzer": False, + "gc_stress": options.gc_stress, + "isolates": options.isolates, + "mode": mode, "no_i18n": options.no_i18n, + "system": utils.GuessOS(), } all_tests = [] num_tests = 0 -- 2.7.4