-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: attempt to shard huge test targets more #98834
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))" | ||
|
||
source "$dir/teamcity-support.sh" # For $root | ||
source "$dir/teamcity-bazel-support.sh" # For run_bazel | ||
|
||
tc_start_block "Run unit tests" | ||
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e TC_BUILD_BRANCH -e GITHUB_API_TOKEN -e BUILD_VCS_NUMBER -e TC_BUILD_ID -e TC_SERVER_URL -e TC_BUILDTYPE_ID -e GITHUB_REPO" run_bazel build/teamcity/cockroach/ci/tests/unit_tests_ccl_impl.sh | ||
tc_end_block "Run unit tests" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -xeuo pipefail | ||
|
||
dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))" | ||
|
||
source "$dir/teamcity-support.sh" # for 'tc_release_branch' | ||
|
||
bazel build //pkg/cmd/bazci --config=ci | ||
|
||
EXTRA_PARAMS="" | ||
|
||
if tc_release_branch; then | ||
# enable up to 2 retries (3 attempts, worst-case) per test executable to report flakes but only on release branches (i.e., not staging) | ||
EXTRA_PARAMS=" --flaky_test_attempts=3" | ||
fi | ||
|
||
$(bazel info bazel-bin --config=ci)/pkg/cmd/bazci/bazci_/bazci -- test --config=cinolint -c fastbuild \ | ||
//pkg:ccl_tests \ | ||
--profile=/artifacts/profile.gz $EXTRA_PARAMS |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,11 @@ go_test( | |
"//pkg/sql/logictest:testdata", # keep | ||
"//pkg/sql/opt/exec/execbuilder:testdata", # keep | ||
], | ||
shard_count = 16, | ||
tags = ["cpu:2"], | ||
shard_count = 48, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A few questions:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We upload bazel trace profile to artifacts on each unit tests run. I looked at some runs, found targets that had large shards or bottle-necking the process, and sharded them more. Mainly, logictests, backupccl, schemachangerccl, kvserver. If a logictests package has less than 48 tests, it gets n number of shards where n is the number of tests.
Good question. Looking. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Each shard gets n cores if |
||
tags = [ | ||
"ccl_test", | ||
"cpu:2", | ||
], | ||
deps = [ | ||
"//pkg/build/bazel", | ||
"//pkg/ccl", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not maintain the small, medium, large, enormous categories for CCL tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Because we don't use them, we can easily add them if we need to though.