Index: test/jenkins/test_monorepo_build.py =================================================================== --- test/jenkins/test_monorepo_build.py +++ test/jenkins/test_monorepo_build.py @@ -137,3 +137,13 @@ # Test long should always do check-all, since that is what many bots expect. # RUN: python %{src_root}/zorg/jenkins/monorepo_build.py cmake testlong | FileCheck --check-prefix CHECK-TTARGETS2 %s # CHECK-TTARGETS2: '/usr/local/bin/ninja' '-v' '-k' '0' 'check-all' + +# Test to check if timeout flag is actually being set +# RUN: python %{src_root}/zorg/jenkins/monorepo_build.py cmake all --timeout=900 > %t-timeout.log +# RUN: FileCheck --check-prefix CHECK-TIMEOUT < %t-timeout.log %s +# CHECK-TIMEOUT: '--timeout=900' + +# Test to check if default timeout is being set to 600 +# RUN: python %{src_root}/zorg/jenkins/monorepo_build.py cmake all > %t-timeout-default.log +# RUN: FileCheck --check-prefix CHECK-TIMEOUT-DEFAULT < %t-timeout-default.log %s +# CHECK-TIMEOUT-DEFAULT: '--timeout=600' \ No newline at end of file Index: zorg/jenkins/monorepo_build.py =================================================================== --- zorg/jenkins/monorepo_build.py +++ zorg/jenkins/monorepo_build.py @@ -28,7 +28,6 @@ import dep # noqa - def readme_name(repo): """Given a repo, return the name of the readme file.""" if repo == "libcxx": @@ -307,8 +306,8 @@ run_ws([conf.sccache_path, "--start-server"], env={"SCCACHE_IDLE_TIMEOUT": "0"}) cmake_cmd += ['-DCMAKE_C_COMPILER_LAUNCHER=' + conf.sccache_path] cmake_cmd += ['-DCMAKE_CXX_COMPILER_LAUNCHER=' + conf.sccache_path] - - lit_flags = ['--xunit-xml-output=testresults.xunit.xml', '-v', '-vv', '--timeout=600'] + timeout = conf.timeout + lit_flags = ['--xunit-xml-output=testresults.xunit.xml', '-v', '-vv', '--timeout=' + str(timeout)] if conf.max_parallel_tests: lit_flags += ['-j', conf.max_parallel_tests] cmake_cmd += ['-DLLVM_LIT_ARGS={}'.format(' '.join(lit_flags))] @@ -404,7 +403,7 @@ if conf.thinlto: cmake_cachefile_thinlto = '-ThinLTO' cmake_cachefile = '{}/clang/cmake/caches/Apple-stage2{}.cmake'.format( - conf.srcdir(), cmake_cachefile_thinlto) + conf.srcdir(), cmake_cachefile_thinlto) cmake_command = env + ["/usr/local/bin/cmake", '-G', 'Ninja', '-C', cmake_cachefile, @@ -447,8 +446,9 @@ if conf.CC(): cmake_command.extend(['-DCMAKE_C_COMPILER=' + conf.CC(), '-DCMAKE_CXX_COMPILER=' + conf.CC() + "++"]) + timeout = conf.timeout + lit_flags = ['--xunit-xml-output=testresults.xunit.xml', '-v', '-vv', '--timeout=' + str(timeout)] - lit_flags = ['--xunit-xml-output=testresults.xunit.xml', '-v', '-vv', '--timeout=600'] if conf.max_parallel_tests: lit_flags += ['-j', conf.max_parallel_tests] cmake_command.extend( @@ -530,16 +530,16 @@ cmake_build_type = conf.cmake_build_type if conf.cmake_build_type else 'RelWithDebInfo' # Construct dotest.py arguments. - dotest_args=['--arch', 'x86_64', '--build-dir', - conf.lldbbuilddir()+'/lldb-test-build.noindex', - '-s='+log_dir, - '-t', - '--env', 'TERM=vt100'] + dotest_args = ['--arch', 'x86_64', '--build-dir', + conf.lldbbuilddir() + '/lldb-test-build.noindex', + '-s=' + log_dir, + '-t', + '--env', 'TERM=vt100'] dotest_args.extend(conf.dotest_flags) # Construct lit arguments. lit_args = ['-v', '--time-tests', '--shuffle', - '--xunit-xml-output={}'.format(results_file), '-v'] + '--xunit-xml-output={}'.format(results_file), '-v'] if conf.max_parallel_tests: lit_args.extend(['-j', conf.max_parallel_tests]) if variant == 'sanitized': @@ -591,7 +591,6 @@ '-DCMAKE_CXX_COMPILER=' + conf.CC() + "++" ]) - header("Clean") delete_module_caches(conf.workspace) footer() @@ -836,7 +835,8 @@ run_cmd(conf.installdir(), tar) - mkdir_cmd = ["ssh", "buildslave@" + SERVER, "mkdir", "-p", "/Library/WebServer/Documents/artifacts/" + conf.job_name] + mkdir_cmd = ["ssh", "buildslave@" + SERVER, "mkdir", "-p", + "/Library/WebServer/Documents/artifacts/" + conf.job_name] run_cmd(conf.workspace, mkdir_cmd) @@ -1038,7 +1038,7 @@ parser.add_argument('--projects', dest='llvm_enable_projects', default="clang;clang-tools-extra;compiler-rt;libcxx", help="Semicolon seperated list of projects to build.") - + parser.add_argument('--timeout', dest='timeout', type=int, help='individual test timeout in seconds. ', default='600') args = parser.parse_args() if args.thinlto: args.lto = True