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

ttl,partition: Stabilize test TestReorgPartExtensivePart #53017

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mjonss
Copy link
Contributor

@mjonss mjonss commented May 2, 2024

The tests makes direct changes to table.Meta, which is later read by TTL. Fixed by disable TTL and not trigger the TTL loop when disabled.

What problem does this PR solve?

Issue Number: close #51845

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    Ran this on both a linux and a macOs box without issues.
(cd pkg/table/tables/test/partition ; go test -v -tags intest -race -run TestReorgPartExtensivePart -failfast -count 1000 -timeout 90m)
  • No need to test

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

It makes direct changes to table.Meta, which is later read by TTL
Fixed by disable TTL and not trigger the TTL loop when disabled.
@ti-chi-bot ti-chi-bot bot added release-note-none do-not-merge/needs-triage-completed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 2, 2024
Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.3057%. Comparing base (600b2ed) to head (0aeedfb).
Report is 79 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #53017         +/-   ##
=================================================
- Coverage   72.0365%   55.3057%   -16.7309%     
=================================================
  Files          1499       1614        +115     
  Lines        431224     600894     +169670     
=================================================
+ Hits         310639     332329      +21690     
- Misses       101303     245704     +144401     
- Partials      19282      22861       +3579     
Flag Coverage Δ
integration 36.4573% <100.0000%> (?)
unit 71.2182% <100.0000%> (-0.0290%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 46.6317% <ø> (+8.2670%) ⬆️

Copy link

ti-chi-bot bot commented May 15, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hawkingrei
Once this PR has been reviewed and has the lgtm label, please assign zimulala for approval. For more information see the Code Review Process.

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

Needs approval from an approver in each of these files:

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

Copy link

ti-chi-bot bot commented May 15, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-15 04:03:11.291064853 +0000 UTC m=+1625945.048200438: ☑️ agreed by hawkingrei.

@@ -286,6 +286,9 @@ func (m *JobManager) jobLoop() error {
}

func (m *JobManager) onTimerTick(se session.Session, rt *ttlTimerRuntime, syncer *TTLTimersSyncer, now time.Time) {
if !variable.EnableTTLJob.Load() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will make some logic changes. How about just stopping ttl manager in the tests? See:

store, dom := testkit.CreateMockStoreAndDomain(t)
tk := testkit.NewTestKit(t, store)
// stop TTLJobManager to avoid unnecessary job schedule and make test stable
dom.TTLJobManager().Stop()
require.NoError(t, dom.TTLJobManager().WaitStopped(context.Background(), time.Minute))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-1-more-lgtm release-note-none 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.

DATA RACE TestReorgPartExtensivePart
3 participants