diff --git a/contrib/teamcity/build.sh b/contrib/teamcity/build.sh --- a/contrib/teamcity/build.sh +++ b/contrib/teamcity/build.sh @@ -46,7 +46,7 @@ if [[ ! -z "${DISABLE_WALLET}" ]]; then echo "Skipping rpc testing due to disabled wallet functionality." elif [[ "${BRANCH}" == "master" ]]; then - ./test/functional/test_runner.py --extended --tmpdirprefix=output + ./test/functional/test_runner.py --cutoff=600 --tmpdirprefix=output else ./test/functional/test_runner.py --tmpdirprefix=output fi diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -81,7 +81,8 @@ # Used to limit the number of tests, when list of tests is not provided on command line # When --extended is specified, we run all tests, otherwise # we only run a test if its execution time in seconds does not exceed EXTENDED_CUTOFF -EXTENDED_CUTOFF = 600 +DEFAULT_EXTENDED_CUTOFF = 40 +DEFAULT_JOBS = (multiprocessing.cpu_count() // 3) + 1 class TestCase(): @@ -155,11 +156,13 @@ '--exclude', '-x', help='specify a comma-seperated-list of scripts to exclude. Do not include the .py extension in the name.') parser.add_argument('--extended', action='store_true', help='run the extended test suite in addition to the basic tests') + parser.add_argument('--cutoff', type=int, default=DEFAULT_EXTENDED_CUTOFF, + help='set the cutoff runtime for what tests get run') parser.add_argument('--force', '-f', action='store_true', help='run tests even on platforms where they are disabled by default (e.g. windows).') parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit') - parser.add_argument('--jobs', '-j', type=int, default=(multiprocessing.cpu_count() // 3) + 1, + parser.add_argument('--jobs', '-j', type=int, default=DEFAULT_JOBS, help='how many test scripts to run in parallel. Default=4.') parser.add_argument('--keepcache', '-k', action='store_true', help='the default behavior is to flush the cache directory on startup. --keepcache retains the cache from the previous testrun.') @@ -219,9 +222,8 @@ else: # No individual tests have been specified. # Run all tests that do not exceed - # EXTENDED_CUTOFF, unless --extended was specified test_list = all_scripts - cutoff = EXTENDED_CUTOFF + cutoff = args.cutoff if args.extended: cutoff = sys.maxsize