File tree Expand file tree Collapse file tree 4 files changed +38
-2
lines changed Expand file tree Collapse file tree 4 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ env_vars: {
51
51
value: " python-docs-samples-tests-py36"
52
52
}
53
53
54
+ # Number of test workers.
55
+ env_vars: {
56
+ key: " NUM_TEST_WORKERS"
57
+ value: " 10"
58
+ }
59
+
54
60
env_vars: {
55
61
key: " TRAMPOLINE_DOCKERFILE"
56
62
value: " .kokoro/docker/Dockerfile"
Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ env_vars: {
51
51
value: " python-docs-samples-tests-py37"
52
52
}
53
53
54
+ # Number of test workers.
55
+ env_vars: {
56
+ key: " NUM_TEST_WORKERS"
57
+ value: " 10"
58
+ }
59
+
54
60
env_vars: {
55
61
key: " TRAMPOLINE_DOCKERFILE"
56
62
value: " .kokoro/docker/Dockerfile"
Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ env_vars: {
51
51
value: " python-docs-samples-tests-py38"
52
52
}
53
53
54
+ # Number of test workers.
55
+ env_vars: {
56
+ key: " NUM_TEST_WORKERS"
57
+ value: " 10"
58
+ }
59
+
54
60
env_vars: {
55
61
key: " TRAMPOLINE_DOCKERFILE"
56
62
value: " .kokoro/docker/Dockerfile"
Original file line number Diff line number Diff line change @@ -51,6 +51,19 @@ if [[ $* == *--only-diff-head* ]]; then
51
51
fi
52
52
fi
53
53
54
+ # Because Kokoro runs presubmit builds simalteneously, we often see
55
+ # quota related errors. I think we can avoid this by changing the
56
+ # order of tests to execute (e.g. reverse order for py-3.8
57
+ # build). Currently there's no easy way to do that with btlr, so we
58
+ # temporarily wait few minutes to avoid quota issue for py-3.8
59
+ # presubmit build.
60
+ if [[ " ${RUN_TESTS_SESSION} " == " py-3.8" ]] \
61
+ && [[ " ${KOKORO_JOB_NAME} " == * presubmit ]]; then
62
+ echo -n " Detected py-3.8 presubmit build,"
63
+ echo " Wait few minutes to avoid quota issues."
64
+ sleep 5m
65
+ fi
66
+
54
67
if [[ -z " ${PROJECT_ROOT:- } " ]]; then
55
68
PROJECT_ROOT=" github/python-docs-samples"
56
69
fi
@@ -108,10 +121,15 @@ test_prog="${PROJECT_ROOT}/.kokoro/tests/run_single_test.sh"
108
121
btlr_args=(
109
122
" run"
110
123
" **/requirements.txt"
111
- " --max-concurrency"
112
- " 30"
113
124
)
114
125
126
+ if [[ -n " ${NUM_TEST_WORKERS:- } " ]]; then
127
+ btlr_args+=(
128
+ " --max-concurrency"
129
+ " ${NUM_TEST_WORKERS} "
130
+ )
131
+ fi
132
+
115
133
if [[ -n " ${DIFF_FROM:- } " ]]; then
116
134
btlr_args+=(
117
135
" --git-diff"
You can’t perform that action at this time.
0 commit comments