From 1709f7992c244c609dd0462ee8e583839e9780ab Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Fri, 10 Sep 2021 14:40:45 -0400 Subject: [PATCH] CI (Buildkite, code coverage): increase the value of `JULIA_WORKER_TIMEOUT` on the code coverage job (#42193) --- .buildkite/pipelines/scheduled/0_webui.yml | 2 +- .../scheduled/coverage/coverage_linux64.yml | 5 ++- .../scheduled/coverage/run_tests_parallel.jl | 34 +++++++++++-------- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.buildkite/pipelines/scheduled/0_webui.yml b/.buildkite/pipelines/scheduled/0_webui.yml index 8aaf812376b5c..3aa1b575316d8 100644 --- a/.buildkite/pipelines/scheduled/0_webui.yml +++ b/.buildkite/pipelines/scheduled/0_webui.yml @@ -21,4 +21,4 @@ steps: # verifies the treehash of the pipeline itself and the inputs listed in `inputs` signed_pipelines: - pipeline: .buildkite/pipelines/scheduled/coverage/coverage_linux64.yml - signature: "U2FsdGVkX1+lpFo/nKzx3c6xCZPKYTAuunXpOsZG4+s4+iU5LfEpMvtNvpKQjDugRoxQxCItMqB6vr4KZN3KtKhjkLbr8ExAyaPil/N/uFhrLlpwNem9dxHbPrU2l7qo" + signature: U2FsdGVkX1+FtqbbxyzoI/j0InDefRQ3OR06BAM2EWRhDG3SiwiPcOREudCTJ+1Z+AEVwVz5KTgw9lBVO1yjcWts3XePIy/W+arN4V+t97Dfuf4wsAr9ubpQ10GaoFnK diff --git a/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml b/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml index ce7a3aca4227d..b1e2eaff61497 100644 --- a/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml +++ b/.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml @@ -29,7 +29,10 @@ steps: git config --global init.defaultBranch master echo "--- Run Julia tests in parallel with code coverage enabled" - ./julia --code-coverage=all --sysimage-native-code=no .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl + export JULIA_NUM_THREADS=1 + export JULIA_WORKER_TIMEOUT=1200 # 1200 seconds = 20 minutes + ./julia -e 'import Distributed; @info "" Distributed.worker_timeout()' + ./julia .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl echo "--- Process and upload coverage information" ./julia .buildkite/pipelines/scheduled/coverage/upload_coverage.jl diff --git a/.buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl b/.buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl index 6da608b5e8be9..b6eed225f652d 100644 --- a/.buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl +++ b/.buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl @@ -1,25 +1,29 @@ # Important note: even if one or more tests fail, we will still exit with status code 0. - +# # The reason for this is that we always want to upload code coverage, even if some of the # tests fail. Therefore, even if the `coverage_linux64` builder passes, you should not # assume that all of the tests passed. If you want to know if all of the tests are passing, # please look at the status of the `tester_*` builders (e.g. `tester_linux64`). -# When running this file, make sure to set all of the following command-line flags: -# 1. `--code-coverage=all` -# 2. `--sysimage-native-code=no` +const ncores = Sys.CPU_THREADS +@info "" Sys.CPU_THREADS +@info "" ncores -empty!(Base.DEPOT_PATH) -push!(Base.DEPOT_PATH, mktempdir(; cleanup = true)) +script_native_yes = """ + Base.runtests(["cmdlineargs"]; ncores = $(ncores)) +""" +script_native_no = """ + Base.runtests(["all", "--skip", "cmdlineargs"]; ncores = $(ncores)) +""" -const tests = "all" -const ncores = Sys.CPU_THREADS +base_cmd = `$(Base.julia_cmd()) --code-coverage=all` +cmd_native_yes = `$(base_cmd) --sysimage-native-code=yes -e $(script_native_yes)` +cmd_native_no = `$(base_cmd) --sysimage-native-code=no -e $(script_native_no)` -@info "" Sys.CPU_THREADS -@info "" tests ncores +@info "Running command" cmd_native_yes +p1 = run(pipeline(cmd_native_yes; stdin, stdout, stderr); wait = false) +wait(p1) -try - Base.runtests(tests; ncores) -catch ex - @error "" exception=(ex, catch_backtrace()) -end +@info "Running command" cmd_native_no +p2 = run(pipeline(cmd_native_no; stdin, stdout, stderr); wait = false) +wait(p2)