Skip to content

Commit 5cda02b

Browse files
committed
dev: refine behavior of --cpus further
- `--local_cpu_resources` changed to `--local_resources=cpu=` - `--cpus` now additionaly implies `--local_test_jobs`, which should be set to an equivalent value. Also, using `--cpus` gives: Epic: None Fixes: #151139 Release Note: None
1 parent 7159307 commit 5cda02b

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fi
88
set -euo pipefail
99

1010
# Bump this counter to force rebuilding `dev` on all machines.
11-
DEV_VERSION=113
11+
DEV_VERSION=114
1212

1313
THIS_DIR=$(cd "$(dirname "$0")" && pwd)
1414
BINARY_DIR=$THIS_DIR/bin/dev-versions

pkg/cmd/dev/testdata/datadriven/bench

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exec
2626
dev bench pkg/spanconfig/spanconfigkvsubscriber -f=BenchmarkSpanConfigDecoder --cpus=10 --ignore-cache=false -v --timeout=50s
2727
----
2828
echo $HOME/.cache
29-
bazel test --local_cpu_resources=10 --jobs=10 --test_timeout=50 pkg/spanconfig/spanconfigkvsubscriber:all --test_arg -test.run=- --test_arg -test.bench=BenchmarkSpanConfigDecoder --test_sharding_strategy=disabled --test_arg -test.cpu --test_arg 1 --test_arg -test.v --test_arg -test.benchmem --crdb_test_off --crdb_bench --test_env COCKROACH_TEST_FIXTURES_DIR=crdb-mock-test-fixtures/crdb-test-fixtures --sandbox_writable_path=crdb-mock-test-fixtures/crdb-test-fixtures --test_output streamed
29+
bazel test --local_resources=cpu=10 --jobs=10 --local_test_jobs=10 --test_timeout=50 pkg/spanconfig/spanconfigkvsubscriber:all --test_arg -test.run=- --test_arg -test.bench=BenchmarkSpanConfigDecoder --test_sharding_strategy=disabled --test_arg -test.cpu --test_arg 1 --test_arg -test.v --test_arg -test.benchmem --crdb_test_off --crdb_bench --test_env COCKROACH_TEST_FIXTURES_DIR=crdb-mock-test-fixtures/crdb-test-fixtures --sandbox_writable_path=crdb-mock-test-fixtures/crdb-test-fixtures --test_output streamed
3030

3131
exec
3232
dev bench pkg/bench -f='BenchmarkTracing/1node/scan/trace=off' --test-args '-test.memprofile=mem.out -test.cpuprofile=cpu.out'

pkg/cmd/dev/testdata/datadriven/dev-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cp sandbox/pkg/cmd/cockroach-short/cockroach-short_/cockroach-short crdb-checkou
1313
exec
1414
dev build cockroach-short --cpus=12
1515
----
16-
bazel build --local_cpu_resources=12 --jobs=12 //pkg/cmd/cockroach-short:cockroach-short --build_event_binary_file=/tmp/path
16+
bazel build --local_resources=cpu=12 --jobs=12 --local_test_jobs=12 //pkg/cmd/cockroach-short:cockroach-short --build_event_binary_file=/tmp/path
1717
bazel info workspace --color=no
1818
mkdir crdb-checkout/bin
1919
bazel info bazel-bin --color=no

pkg/cmd/dev/testdata/datadriven/testlogic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bazel info workspace --color=no
5959
bazel info workspace --color=no
6060
bazel run pkg/cmd/generate-logictest -- -out-dir=crdb-checkout
6161
bazel run //pkg/gen:schemachanger
62-
bazel test //pkg/sql/logictest/tests/... --test_env=GOTRACEBACK=all --local_cpu_resources=8 --jobs=8 --test_arg -show-sql --test_timeout=60 --test_env=COCKROACH_STRESS=true --notest_keep_going --runs_per_test=500 --test_filter auto_span_config_reconciliation/ --test_sharding_strategy=disabled --test_output errors
62+
bazel test //pkg/sql/logictest/tests/... --test_env=GOTRACEBACK=all --local_resources=cpu=8 --jobs=8 --local_test_jobs=8 --test_arg -show-sql --test_timeout=60 --test_env=COCKROACH_STRESS=true --notest_keep_going --runs_per_test=500 --test_filter auto_span_config_reconciliation/ --test_sharding_strategy=disabled --test_output errors
6363

6464
exec
6565
dev testlogic base --files=auto_span_config_reconciliation --stress

pkg/cmd/dev/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,9 @@ func (d *dev) getMergeBaseHash(ctx context.Context) (string, error) {
264264

265265
func addCommonBazelArguments(args *[]string) {
266266
if numCPUs != 0 {
267-
*args = append(*args, fmt.Sprintf("--local_cpu_resources=%d", numCPUs))
267+
*args = append(*args, fmt.Sprintf("--local_resources=cpu=%d", numCPUs))
268268
*args = append(*args, fmt.Sprintf("--jobs=%d", numCPUs))
269+
*args = append(*args, fmt.Sprintf("--local_test_jobs=%d", numCPUs))
269270
}
270271
if pgoEnabled {
271272
*args = append(*args, "--config=pgo")

0 commit comments

Comments
 (0)