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

test: fix unstable TestIndexChange and TestAlterAddConstraintStateChange3 #50144

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

jiyfhust
Copy link
Contributor

@jiyfhust jiyfhust commented Jan 6, 2024

What problem does this PR solve?

Issue Number: close #50079, close #49825

Problem Summary:

To make the tests easy to reproduce:

--- a/pkg/ddl/job_table.go
+++ b/pkg/ddl/job_table.go
@@ -434,6 +434,9 @@ func (d *ddl) delivery2worker(wk *worker, pool *workerPool, job *model.Job) {
                                d.mu.hook.OnSchemaStateChanged(schemaVer)
                                d.mu.RUnlock()
                        }
+                       if job.SchemaState == model.StatePublic && job.State == model.JobStateSynced && job.TableName == "t" && job.Type == model.ActionCreateTable {
+                               time.Sleep(3000 * time.Millisecond)
+                       }
 
                        d.mu.RLock()
                        d.mu.hook.OnJobUpdated(job)

This pr:

  1. Solve the unstable test.
  2. Clean some useless code and make some enhencement.

What changed and how does it work?

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. do-not-merge/needs-triage-completed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 6, 2024
Copy link

tiprow bot commented Jan 6, 2024

Hi @jiyfhust. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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/test-infra repository.

@jiyfhust
Copy link
Contributor Author

jiyfhust commented Jan 6, 2024

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jan 6, 2024
Copy link

codecov bot commented Jan 6, 2024

Codecov Report

Merging #50144 (7681bfc) into master (4c7102c) will decrease coverage by 11.1741%.
Report is 54 commits behind head on master.
The diff coverage is 69.2307%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #50144         +/-   ##
=================================================
- Coverage   79.3291%   68.1551%   -11.1741%     
=================================================
  Files          2447       2576        +129     
  Lines        673702     858640     +184938     
=================================================
+ Hits         534442     585207      +50765     
- Misses       117888     249678     +131790     
- Partials      21372      23755       +2383     
Flag Coverage Δ
integration 38.5371% <ø> (?)
unit 80.0434% <69.2307%> (+0.7142%) ⬆️

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

Components Coverage Δ
dumpling 73.6130% <ø> (ø)
parser ∅ <ø> (∅)
br 72.3057% <ø> (+3.8084%) ⬆️

@hawkingrei
Copy link
Member

/test all

1 similar comment
@hawkingrei
Copy link
Member

/test all

Copy link

tiprow bot commented Jan 6, 2024

@jiyfhust: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tiprow_fast_test 7681bfc link true /test tiprow_fast_test

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 10, 2024
@Defined2014
Copy link
Contributor

/run check-issue-triage-complete

@Defined2014
Copy link
Contributor

/run-check-issue-triage-complete

@Defined2014
Copy link
Contributor

Defined2014 commented Jan 10, 2024

/cc @tangenta @zimulala
PTAL

Copy link

ti-chi-bot bot commented Jan 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, zimulala

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:

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 added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 11, 2024
Copy link

ti-chi-bot bot commented Jan 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-10 08:06:36.100549712 +0000 UTC m=+430585.684803401: ☑️ agreed by Defined2014.
  • 2024-01-11 03:14:06.406696994 +0000 UTC m=+499435.990950680: ☑️ agreed by zimulala.

@Defined2014
Copy link
Contributor

/test mysql-test

Copy link

tiprow bot commented Jan 11, 2024

@Defined2014: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test mysql-test

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/test-infra repository.

@Defined2014
Copy link
Contributor

/retest

@ti-chi-bot ti-chi-bot bot merged commit ef239ac into pingcap:master Jan 11, 2024
21 of 22 checks passed
@jiyfhust jiyfhust deleted the fix_index_change_test branch January 11, 2024 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flaky test TestIndexChange panic in the TestAlterAddConstraintStateChange3
4 participants