8139272: Add configure variable to set concurrency for jtreg tests
authorehelin
Tue, 15 Dec 2015 11:04:18 +0100
changeset 34594 7e0595aab028
parent 34593 9fd6df05d847
child 34595 09596fe63e2d
8139272: Add configure variable to set concurrency for jtreg tests Reviewed-by: erikj, ihse
common/autoconf/build-performance.m4
common/autoconf/configure.ac
common/autoconf/generated-configure.sh
common/autoconf/spec.gmk.in
make/Help.gmk
make/InitSupport.gmk
make/MainSupport.gmk
test/Makefile
--- a/common/autoconf/build-performance.m4	Mon Dec 14 20:32:22 2015 +0000
+++ b/common/autoconf/build-performance.m4	Tue Dec 15 11:04:18 2015 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -149,6 +149,19 @@
   AC_SUBST(JOBS)
 ])
 
+AC_DEFUN_ONCE([BPERF_SETUP_TEST_JOBS],
+[
+  # The number of test jobs will be chosen automatically if TEST_JOBS is 0
+  AC_ARG_WITH(test-jobs, [AS_HELP_STRING([--with-test-jobs],
+      [number of parallel tests jobs to run @<:@based on build jobs@:>@])])
+  if test "x$with_test_jobs" = x; then
+      TEST_JOBS=0
+  else
+      TEST_JOBS=$with_test_jobs
+  fi
+  AC_SUBST(TEST_JOBS)
+])
+
 AC_DEFUN([BPERF_SETUP_CCACHE],
 [
   AC_ARG_ENABLE([ccache],
--- a/common/autoconf/configure.ac	Mon Dec 14 20:32:22 2015 +0000
+++ b/common/autoconf/configure.ac	Tue Dec 15 11:04:18 2015 +0100
@@ -233,6 +233,7 @@
 BPERF_SETUP_BUILD_CORES
 BPERF_SETUP_BUILD_MEMORY
 BPERF_SETUP_BUILD_JOBS
+BPERF_SETUP_TEST_JOBS
 
 # Setup arguments for the boot jdk (after cores and memory have been setup)
 BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
--- a/common/autoconf/generated-configure.sh	Mon Dec 14 20:32:22 2015 +0000
+++ b/common/autoconf/generated-configure.sh	Tue Dec 15 11:04:18 2015 +0100
@@ -646,6 +646,7 @@
 JAVA_FLAGS_JAVAC
 JAVA_FLAGS_BIG
 JAVA_FLAGS
+TEST_JOBS
 JOBS
 MEMORY_SIZE
 NUM_CORES
@@ -1142,6 +1143,7 @@
 with_num_cores
 with_memory_size
 with_jobs
+with_test_jobs
 with_boot_jdk_jvmargs
 with_sjavac_server_java
 enable_sjavac
@@ -2061,6 +2063,8 @@
                           --with-memory-size=1024 [probed]
   --with-jobs             number of parallel jobs to let make run [calculated
                           based on cores and memory]
+  --with-test-jobs        number of parallel tests jobs to run [based on build
+                          jobs]
   --with-boot-jdk-jvmargs specify JVM arguments to be passed to all java
                           invocations of boot JDK, overriding the default
                           values, e.g --with-boot-jdk-jvmargs="-Xmx8G
@@ -3747,7 +3751,7 @@
 
 
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -3785,6 +3789,8 @@
 
 
 
+
+
 ################################################################################
 #
 # Optionally enable distributed compilation of native code using icecc/icecream
@@ -4728,7 +4734,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1449850507
+DATE_WHEN_GENERATED=1450172823
 
 ###############################################################################
 #
@@ -57253,6 +57259,21 @@
 
 
 
+  # The number of test jobs will be chosen automatically if TEST_JOBS is 0
+
+# Check whether --with-test-jobs was given.
+if test "${with_test_jobs+set}" = set; then :
+  withval=$with_test_jobs;
+fi
+
+  if test "x$with_test_jobs" = x; then
+      TEST_JOBS=0
+  else
+      TEST_JOBS=$with_test_jobs
+  fi
+
+
+
 # Setup arguments for the boot jdk (after cores and memory have been setup)
 
   ##############################################################################
--- a/common/autoconf/spec.gmk.in	Mon Dec 14 20:32:22 2015 +0000
+++ b/common/autoconf/spec.gmk.in	Tue Dec 15 11:04:18 2015 +0100
@@ -270,6 +270,7 @@
 
 # Number of parallel jobs to use for compilation
 JOBS?=@JOBS@
+TEST_JOBS?=@TEST_JOBS@
 
 # Default make target
 DEFAULT_MAKE_TARGET:=@DEFAULT_MAKE_TARGET@
--- a/make/Help.gmk	Mon Dec 14 20:32:22 2015 +0000
+++ b/make/Help.gmk	Tue Dec 15 11:04:18 2015 +0100
@@ -83,6 +83,7 @@
 	$(info $(_)                        # To see executed command lines, use LOG=debug)
 	$(info $(_) JOBS=<n>               # Run <n> parallel make jobs)
 	$(info $(_)                        # Note that -jN does not work as expected!)
+	$(info $(_) TEST_JOBS=<n>          # Run <n> parallel test jobs)
 	$(info $(_) CONF_CHECK=<method>    # What to do if spec file is out of date)
 	$(info $(_)                        # method is 'auto', 'ignore' or 'fail' (default))
 	$(info $(_) make test TEST=<test>  # Only run the given test or tests, e.g.)
--- a/make/InitSupport.gmk	Mon Dec 14 20:32:22 2015 +0000
+++ b/make/InitSupport.gmk	Tue Dec 15 11:04:18 2015 +0100
@@ -40,7 +40,8 @@
   ##############################################################################
 
   # Make control variables, handled by Init.gmk
-  INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK COMPARE_BUILD
+  INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
+      COMPARE_BUILD
 
   # All known make control variables
   MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER
--- a/make/MainSupport.gmk	Mon Dec 14 20:32:22 2015 +0000
+++ b/make/MainSupport.gmk	Tue Dec 15 11:04:18 2015 +0100
@@ -35,7 +35,8 @@
 	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
 	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \
 	    TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \
-	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $1) || true
+	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) TEST_JOBS=$(TEST_JOBS) \
+	    JOBS=$(JOBS) $1) || true
 endef
 
 # Cleans the dir given as $1
--- a/test/Makefile	Mon Dec 14 20:32:22 2015 +0000
+++ b/test/Makefile	Tue Dec 15 11:04:18 2015 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -60,18 +60,28 @@
 # Bring in closed test targets if present
 -include $(TOPDIR)/closed/test/Makefile
 
+ifeq ($(TEST_JOBS), 0)
+  JDK_TEST_JOBS=$(JOBS)
+else
+  JDK_TEST_JOBS=$(TEST_JOBS)
+endif
 # Test targets
 langtools_% :
-	@$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), CONCURRENCY=$(JDK_TEST_JOBS) JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
 
 jdk_% core_%s svc_%:
-	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@)
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
 
 jaxp_%:
-	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JAXP_DIR), TEST="$@" $@)
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JAXP_DIR), CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
 
+ifeq ($(TEST_JOBS), 0)
+  HOTSPOT_TEST_JOBS=1
+else
+  HOTSPOT_TEST_JOBS=$(TEST_JOBS)
+endif
 hotspot_%:
-	@$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), TEST="$@" $@)
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), CONCURRENCY=$(HOTSPOT_TEST_JOBS) TEST="$@" $@)
 
 #
 # jtreg_tests