Skip to content
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

util: split the tests of workloadrepo into multiple shard #59030

Merged

Conversation

winoros
Copy link
Member

@winoros winoros commented Jan 19, 2025

What problem does this PR solve?

Issue Number: ref #58247

Problem Summary:

What changed and how does it work?

In #58266, the timeout was set to long. From https://bazel.build/reference/test-encyclopedia, we can see that the long is 900s, which is too long for a whole dir.
If it really has some tests exceeding the default short threshold, please verify the test first, then consider putting slow ones into a separate dir.

And enable the sharding

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 19, 2025
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 19, 2025
@hawkingrei hawkingrei requested a review from lance6716 January 19, 2025 14:13
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.3223%. Comparing base (36e8e34) to head (b1cbbe8).
Report is 9 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59030        +/-   ##
================================================
+ Coverage   73.0285%   73.3223%   +0.2937%     
================================================
  Files          1684       1685         +1     
  Lines        465663     467372      +1709     
================================================
+ Hits         340067     342688      +2621     
+ Misses       104691     103731       -960     
- Partials      20905      20953        +48     
Flag Coverage Δ
integration 42.7917% <ø> (?)
unit 72.2286% <ø> (+0.0168%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 45.3097% <ø> (+0.0777%) ⬆️

@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 19, 2025
Copy link

ti-chi-bot bot commented Jan 19, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, lance6716

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [hawkingrei,lance6716]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 19, 2025
Copy link

ti-chi-bot bot commented Jan 19, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-01-19 14:10:45.981203 +0000 UTC m=+17173.312122405: ☑️ agreed by hawkingrei.
  • 2025-01-19 14:25:23.075404824 +0000 UTC m=+18050.406324225: ☑️ agreed by lance6716.

@ti-chi-bot ti-chi-bot bot merged commit 5ed9e63 into pingcap:master Jan 19, 2025
24 checks passed
@winoros winoros deleted the correct-shard-test-in-workloadrepo branch January 19, 2025 15:03
@winoros
Copy link
Member Author

winoros commented Jan 19, 2025

and the running time of each test:

➜  tidb git:(fix-unexpected-delete) ✗ gotestsum --format testname -- --tags=intest ./pkg/util/workloadrepo/...
PASS pkg/util/workloadrepo.TestRaceToCreateTablesWorker (7.70s)
PASS pkg/util/workloadrepo.TestMultipleWorker (12.92s)
PASS pkg/util/workloadrepo.TestGlobalWorker (8.47s)
PASS pkg/util/workloadrepo.TestAdminWorkloadRepo (4.16s)
PASS pkg/util/workloadrepo.TestSamplingTimingWorker (23.62s)
PASS pkg/util/workloadrepo.TestSnapshotTimingWorker (15.18s)
PASS pkg/util/workloadrepo.TestStoppingAndRestartingWorker (13.48s)
PASS pkg/util/workloadrepo.TestSettingSQLVariables (15.49s)
PASS pkg/util/workloadrepo.TestCreatePartition (3.65s)
PASS pkg/util/workloadrepo.TestDropOldPartitions (1.44s)
PASS pkg/util/workloadrepo.TestAddNewPartitionsOnStart (1.00s)
PASS pkg/util/workloadrepo.TestHouseKeeperThread (17.15s)
[2025/01/19 21:44:02.706 +08:00] [INFO] [manager.go:431] ["etcd session close failed"] [key=workloadrepo] [id=worker] [error="context canceled"]
PASS pkg/util/workloadrepo.TestCalcNextTick (0.00s)
PASS pkg/util/workloadrepo

DONE 13 tests in 134.829s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants