pingcap / pingcap/tidb

improve test in the planner/casetest

Open
#43,573 0 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

when you run test cases in the remote execution, Here is a simple report about these test cases.

```
INFO: Elapsed time: 676.260s, Critical Path: 548.74s
INFO: 9636 processes: 4269 disk cache hit, 5368 remote.
INFO: Build completed successfully, 9636 total actions
Test cases: finished with 0 passing and 0 failing out of 0 test cases

Executed 282 out of 282 tests: 282 tests pass.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
```

If we dump the detail report. we can read this.

```
WARNING: This information is intended for consumption by Bazel developers only, and may change at any time. Script against it at your own risk
INFO: Profile created on Sat May 06 13:07:34 CST 2023, build ID: bf8e4e04-71bc-45a2-8904-457b634ff6a0, output base: /data2/root/.cache/bazel/_bazel_root/6a98a1fb5f5da1c9e5bd87d2f46d0229

=== PHASE SUMMARY INFORMATION ===

Total launch phase time 4.687 s 0.69%
Total init phase time 7.030 s 1.04%
Total target pattern evaluation phase time 0.000 s 0.00%
Total interleaved loading-and-analysis phase time 10.295 s 1.52%
Total preparation phase time 24.986 s 3.69%
Total execution phase time 629.260 s 93.04%
Total finish phase time 0.062 s 0.01%
---------------------------------------------------------------------
Total run time 676.322 s 100.00%

Critical path (548.744 s):
Time Percentage Description
32.7 ms 0.01% action 'GoToolchainBinaryBuild external/go_sdk/builder [for tool]'
230 ms 0.04% action 'Creating symlink bazel-out/k8-opt-exec-2B5CBBC6-ST-e4bf93cdf86e/bin/external/go_sdk/builder_reset/builder [for tool]'
5.349 s 0.97% action 'GoStdlib external/io_bazel_rules_go/stdlib_/pkg [for tool]'
424 ms 0.08% action 'GoCompilePkg external/org_golang_x_tools/internal/typeparams/typeparams.a [for tool]'
840 ms 0.15% action 'GoCompilePkg external/org_golang_x_tools/go/ast/astutil/astutil.a [for tool]'
47.0 ms 0.01% action 'GoCompilePkg external/org_golang_x_tools/go/types/typeutil/typeutil.a [for tool]'
215 ms 0.04% action 'GoCompilePkg external/co_honnef_go_tools/go/types/typeutil/typeutil.a [for tool]'
138 ms 0.03% action 'GoCompilePkg external/co_honnef_go_tools/go/ir/ir.a [for tool]'
56.5 ms 0.01% action 'GoCompilePkg external/co_honnef_go_tools/internal/passes/buildir/buildir.a [for tool]'
145 ms 0.03% action 'GoCompilePkg external/co_honnef_go_tools/analysis/facts/purity/purity.a [for tool]'
10.2 ms 0.00% action 'GoCompilePkg external/co_honnef_go_tools/analysis/code/code.a [for tool]'
22.0 ms 0.00% action 'GoCompilePkg external/co_honnef_go_tools/internal/sharedcheck/sharedcheck.a [for tool]'
45.2 ms 0.01% action 'GoCompilePkg external/co_honnef_go_tools/simple/simple.a [for tool]'
53.9 ms 0.01% action 'GoCompilePkg build/linter/staticcheck/S1018.a [for tool]'
64.0 ms 0.01% action 'GoCompilePkg build/tidb_nogo_actual~nogo.a [for tool]'
238 ms 0.04% action 'GoLink build/tidb_nogo_actual_/tidb_nogo_actual [for tool]'
33.1 ms 0.01% action 'GoCompilePkg external/org_golang_google_protobuf/internal/detrand/detrand.a'
840 ms 0.15% action 'GoCompilePkg external/org_golang_google_protobuf/internal/errors/errors.a'
667 ms 0.12% action 'GoCompilePkg external/org_golang_google_protobuf/encoding/protowire/protowire.a'
1.510 s 0.28% action 'GoCompilePkg external/org_golang_google_protobuf/reflect/protoreflect/protoreflect.a'
776 ms 0.14% action 'GoCompilePkg external/org_golang_google_protobuf/internal/strs/strs.a'
970 ms 0.18% action 'GoCompilePkg external/org_golang_google_protobuf/internal/encoding/text/text.a'
1.830 s 0.33% action 'GoCompilePkg external/org_golang_google_protobuf/internal/encoding/defval/defval.a'
1.281 s 0.23% action 'GoCompilePkg external/org_golang_google_protobuf/internal/filedesc/filedesc.a'
3.709 s 0.68% action 'GoCompilePkg external/org_golang_google_protobuf/internal/encoding/tag/tag.a'
6.915 s 1.26% action 'GoCompilePkg external/org_golang_google_protobuf/internal/impl/impl.a'
552 ms 0.10% action 'GoCompilePkg external/org_golang_google_protobuf/internal/filetype/filetype.a'
774 ms 0.14% action 'GoCompilePkg external/org_golang_google_protobuf/runtime/protoimpl/protoimpl.a'
2.939 s 0.54% action 'GoCompilePkg external/org_golang_google_protobuf/types/known/durationpb/durationpb.a'
430 ms 0.08% action 'GoCompilePkg external/com_github_golang_protobuf/ptypes/duration/duration.a'
18.5 ms 0.00% action 'GoCompilePkg external/com_github_golang_protobuf/ptypes/ptypes.a'
575 ms 0.10% action 'GoCompilePkg external/org_golang_google_grpc/internal/status/status.a'
56.3 ms 0.01% action 'GoCompilePkg external/org_golang_google_grpc/status/status.a'
50.9 ms 0.01% action 'GoCompilePkg external/org_golang_google_grpc/internal/binarylog/binarylog.a'
53.1 ms 0.01% action 'GoCompilePkg external/org_golang_google_grpc/grpc.a'
123 ms 0.02% action 'GoCompilePkg external/com_github_pingcap_kvproto/pkg/resource_manager/resource_manager.a'
338 ms 0.06% action 'GoCompilePkg external/com_github_pingcap_kvproto/pkg/kvrpcpb/kvrpcpb.a'
111 ms 0.02% action 'GoCompilePkg external/com_github_pingcap_kvproto/pkg/raft_serverpb/raft_serverpb.a'
175 ms 0.03% action 'GoCompilePkg external/com_github_pingcap_kvproto/pkg/pdpb/pdpb.a'
88.5 ms 0.02% action 'GoCompilePkg external/com_github_pingcap_kvproto/pkg/tsopb/tsopb.a'
56.8 ms 0.01% action 'GoCompilePkg external/com_github_tikv_pd_client/client.a'
18.6 ms 0.00% action 'GoCompilePkg external/com_github_tikv_client_go_v2/util/util.a'
22.3 ms 0.00% action 'GoCompilePkg external/com_github_tikv_client_go_v2/error/error.a'
17.6 ms 0.00% action 'GoCompilePkg external/com_github_tikv_client_go_v2/kv/kv.a'
85.4 ms 0.02% action 'GoCompilePkg external/com_github_tikv_client_go_v2/tikvrpc/tikvrpc.a'
68.8 ms 0.01% action 'GoCompilePkg util/resourcegrouptag/resourcegrouptag.a'
729 ms 0.13% action 'GoCompilePkg sessionctx/stmtctx/stmtctx.a'
3.235 s 0.59% action 'GoCompilePkg types/types.a'
370 ms 0.07% action 'GoCompilePkg util/chunk/chunk.a'
356 ms 0.06% action 'GoCompilePkg util/codec/codec.a'
1.047 s 0.19% action 'GoCompilePkg kv/kv.a'
884 ms 0.16% action 'GoCompilePkg structure/structure.a'
1.023 s 0.19% action 'GoCompilePkg meta/meta.a'
970 ms 0.18% action 'GoCompilePkg meta/autoid/autoid.a'
1.548 s 0.28% action 'GoCompilePkg util/tableutil/tableutil.a'
3.874 s 0.71% action 'GoCompilePkg sessionctx/variable/variable.a'
2.523 s 0.46% action 'GoCompilePkg extension/extension.a'
34.4 ms 0.01% action 'GoCompilePkg sessionctx/sessionctx.a'
2.214 s 0.40% action 'GoCompilePkg util/sqlexec/sqlexec.a'
1.518 s 0.28% action 'GoCompilePkg util/mock/mock.a'
40.246 s 7.33% action 'GoCompilePkg expression/expression.a'
5.179 s 0.94% action 'GoCompilePkg util/ranger/ranger.a'
81.6 ms 0.01% action 'GoCompilePkg planner/util/util.a'
1.608 s 0.29% action 'GoCompilePkg statistics/statistics.a'
4.522 s 0.82% action 'GoCompilePkg table/tables/tables.a'
2.368 s 0.43% action 'GoCompilePkg infoschema/infoschema.a'
263 ms 0.05% action 'GoCompilePkg sessiontxn/sessiontxn.a'
129 ms 0.02% action 'GoCompilePkg statistics/handle/handle.a'
341 ms 0.06% action 'GoCompilePkg br/pkg/metautil/metautil.a'
2.298 s 0.42% action 'GoCompilePkg br/pkg/utils/utils.a'
1.774 s 0.32% action 'GoCompilePkg br/pkg/lightning/common/common.a'
946 ms 0.17% action 'GoCompilePkg br/pkg/lightning/verification/verification.a'
1.858 s 0.34% action 'GoCompilePkg br/pkg/lightning/backend/encode/encode.a'
1.903 s 0.35% action 'GoCompilePkg br/pkg/lightning/backend/kv/kv.a'
794 ms 0.14% action 'GoCompilePkg br/pkg/lightning/backend/local/local.a'
1.402 s 0.26% action 'GoCompilePkg ddl/ingest/ingest.a'
8.886 s 1.62% action 'GoCompilePkg ddl/ddl.a'
3.788 s 0.69% action 'GoCompilePkg ddl/schematracker/schematracker.a'
7.091 s 1.29% action 'GoCompilePkg domain/domain.a'
2.962 s 0.54% action 'GoCompilePkg br/pkg/glue/glue.a'
64.251 s 11.71% action 'GoCompilePkg br/pkg/aws/aws.a'
6.616 s 1.21% action 'GoCompilePkg br/pkg/task/task.a'
3.315 s 0.60% action 'GoCompilePkg br/pkg/task/show/show.a'
28.612 s 5.21% action 'GoCompilePkg executor/executor.a'
24.501 s 4.47% action 'GoCompilePkg session/session.a'
9.404 s 1.71% action 'GoCompilePkg store/gcworker/gcworker.a'
7.626 s 1.39% action 'GoCompilePkg store/driver/driver.a'
8.102 s 1.48% action 'GoCompilePkg testkit/testkit.a'
3.498 s 0.64% action 'GoCompilePkg testkit/external/external.a'
25.698 s 4.68% action 'GoCompilePkg planner/core/casetest/casetest_test.internal.a'
2.696 s 0.49% action 'GoCompilePkg planner/core/casetest/casetest_test_test.external.a'
3.588 s 0.65% action 'GoCompilePkg planner/core/casetest/casetest_test~testmain.a'
77.429 s 14.11% action 'GoLink planner/core/casetest/casetest_test_/casetest_test'
0.29 ms 0.00% runfiles for //planner/core/casetest casetest_test
141.647 s 25.81% action 'Testing //planner/core/casetest casetest_test (shard 14 of 50)'
```

it will take 25% time for casetest to be completed.

so we need to speed up it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.