-
Notifications
You must be signed in to change notification settings - Fork 6.1k
*: speed up unit tests and fix flakes #65601
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
base: master
Are you sure you want to change the base?
*: speed up unit tests and fix flakes #65601
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #65601 +/- ##
================================================
+ Coverage 77.8383% 79.4026% +1.5642%
================================================
Files 1978 1908 -70
Lines 542180 531165 -11015
================================================
- Hits 422024 421759 -265
+ Misses 118496 107950 -10546
+ Partials 1660 1456 -204
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/test tidb_parser_test |
|
@wjhuang2016: The specified target(s) for The following commands are available to trigger optional jobs: Use DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@wjhuang2016: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #65600
Problem Summary:
tools/bin/utJUnit timing):GET_LOCK()timeout behavior (MySQL compatibility) and@@global.tidb_slow_log_max_per_secread stability.What changed and how does it work?
Scope / methodology
tools/bin/ut(JUnit XML) and rank by per-testcase time.require.Eventually), cap concurrency in tests, gate stress loops behindtestflag.Long().Key >10s offenders eliminated (local)
pkg/planner/core/tests/extractor: avoid exponential predicate cartesian-product enumeration (CI ~190s → local ~2–3s).pkg/ttl/ttlworker.TestCancelWhileScan: batch insert instead of 10k single-row inserts (CI ~151s → local ~2s).pkg/executor/test/admintestcheck-table locate tests: reduce rows/iterations and batch KV ops (CI ~130s → local ~2s).pkg/server/tests/commontest.TestTopSQLCPUProfile: remove redundant cases and skip normalized-plan decoding unless needed.pkg/ddl/ingest.TestAddGlobalIndexInIngest: shrink partitions/rows and cap DML injections.pkg/dxf/importinto.TestSubmitTaskNextgen: reduce etcd integration cluster size.pkg/executor/test/executor.TestQueryWithKill: bound runtime in normal UT.pkg/table/tables.TestCacheTableBasicReadAndWrite: make cache-table lease test deterministic and remove fixed sleeps.pkg/session/test/bootstraptestupgrade tests: remove redundant re-bootstrap matrices.Flake amplifiers fixed (16)
pkg/executorTestFlashbackClusterWithManyDBspkg/planner/core/casetest/instanceplancacheTestInstancePlanCacheConcurrencySysbenchpkg/ddl/tests/partitionTestMultiSchemaPartitionByGlobalIndexpkg/objstore/objectioTestNewCompressReaderpkg/statistics/handle/cache/internal/lfuTestMemoryControlWithUpdatepkg/store/gcworkerTestLeaderTickpkg/ddlTestBackfillingSchedulerGlobalSortModepkg/server/handler/optimizorTestPlanReplayerWithMultiForeignKeypkg/executor/test/analyzetestTestKillAutoAnalyzepkg/util/memoryTestReleasepkg/util/gctunerTestIssue48741pkg/store/gcworkerTestGCWithPendingTxnpkg/expression/integration_testTestGetLockpkg/storeTestStoreSwitchPeerpkg/utilTestVerifyCommonNameAndRotatebr/pkg/utilsTestTaskRegisterFailedGrant(andTestTaskRegisterFailedReput)Bug fixes (non-test behavior)
pkg/expression/builtin_miscellaneous.go:GET_LOCK()returns0(not error) ontikverr.ErrLockWaitTimeout, aligning with MySQL behavior.pkg/sessionctx/variable/sysvar.go:@@global.tidb_slow_log_max_per_secreturns0when the limiter is unlimited (rate.Inf).Change details (grouped by directory)
tools/check:tools/check/ut.go: addut run --timeout <duration>to override per-test-test.timeout; improve cover profile merge error handling and always clean up temp dirs.pkg/bindinfo:pkg/bindinfo/tests/bind_usage_info_test.go: reduce fixed sleeps and restore global knobs/sysvars after the test.pkg/ddl:pkg/ddl/ingest/integration_test.go: shrink ingest DDL scenarios; cap concurrent DML injections; gate heavier loops behindtestflag.Long().pkg/ddl/backfilling.go,pkg/ddl/job_worker.go: make delay-related failpoints accept configurable values to avoid hard-coded sleeps.pkg/ddl/tests/*: reduce polling rounds in non-long UT; add bounded waits for async delete-range completion; tighten teardown order.pkg/domain:pkg/domain/crossks/cross_ks_test.go: reduce etcd integration cluster size and avoid expensive shared-client patterns.pkg/dxf:pkg/dxf/importinto/job_testkit_test.go: reduce etcd integration cluster size for nextgen keyspace tests.pkg/dxf/framework/integrationtests/*: reduce randomized case counts / tighten waits.pkg/executor:testflag.Long().TestQueryWithKill).pkg/expression:GET_LOCK()timeout behavior fix (MySQL compatibility).pkg/infoschema:EXPLAINto avoid executing heavy cluster queries.pkg/objstore:pkg/objstore/gcs.go: allow unauthenticated GCS client for localhost endpoints in intest (avoid default-cred dependency in tests).pkg/objstore/gcs_test.go: implement expected token endpoints in httptest server to keep the test bounded.pkg/objstore/azblob_test.go: close writer and reuse checksum to avoid resource leak and reduce repeated work.pkg/objstore/objectio/writer_test.go: close resources and remove fragile goroutine-count assertions.pkg/planner:pkg/server:pkg/session:pkg/sessiontxn:pkg/statistics:-cover.pkg/store:pkg/table:require.Eventually.br/pkg/utils:require.Eventually, and add failpoint-controlled retry interval.pkg/util/gctuner:pkg/timer,pkg/ttl,pkg/util:pkg/util/security_test.go: stabilizeTestVerifyCommonNameAndRotateby validating the server-side handshake error log instead of brittle client-side error strings.Local timing artifacts (for reference)
~/.codex-context/tidb--906fbbe4/artifacts/ut_full_nextgen_20260114_122930/parsed/slow_testcases.tsv~/.codex-context/tidb--906fbbe4/artifacts/ut_full_nextgen_20260116_111713/parsed/slow_testcases.tsv~/.codex-context/tidb--906fbbe4/artifacts/ut_full_legacy_20260115_165149/parsed/slow_testcases.tsv~/.codex-context/tidb--906fbbe4/artifacts/ut_full_legacy_20260116_103514/parsed/slow_testcases.tsvCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.