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

ddl: make ddl test more stable #12503

Merged
merged 6 commits into from
Oct 8, 2019
Merged

Conversation

crazycs520
Copy link
Contributor

What problem does this PR solve?

[2019-09-29T12:21:59.328Z] ----------------------------------------------------------------------
[2019-09-29T12:21:59.328Z] FAIL: db_test.go:606: testDBSuite2.TestCancelDropTableAndSchema
[2019-09-29T12:21:59.328Z] 
[2019-09-29T12:21:59.328Z] db_test.go:681:
[2019-09-29T12:21:59.328Z]     c.Assert(err.Error(), Equals, "[ddl:12]cancelled DDL job")
[2019-09-29T12:21:59.328Z] ... obtained string = "[domain:2]Information schema is changed. [try again later]"
[2019-09-29T12:21:59.328Z] ... expected string = "[ddl:12]cancelled DDL job"

The cause problem is:

[2019-09-29T12:21:55.954Z] [2019/09/29 20:21:55.827 +08:00] [INFO] [session.go:1859] ["CRUCIAL OPERATION"] [conn=117] [schemaVersion=55] [cur_db=test_drop_db] [sql="create table if not exists t(c1 int, c2 int)"] [user=]
...
...
...
[2019-09-29T12:21:58.812Z] �[0m[2019/09/29 20:21:58.663 +08:00] [INFO] [session.go:1859] ["CRUCIAL OPERATION"] [conn=117] [schemaVersion=55] [cur_db=test_drop_db] [sql="drop table t;"] [user=]

As you can see, the schemaVersion is 55, the session doesn't load the latest schema.

The simplest way is set the ddl lease for another test case too, but this method can only reduce the probability of occurrence.

The best method is force make the session to reload schema, we can add OnChanged method to do domain.reload for TestDDLCallback to fix this problem, but this method is a little complicated.

Let us just change the lease first.

What is changed and how it works?

Check List

Tests

  • No code

@sre-bot
Copy link
Contributor

sre-bot commented Sep 30, 2019

Thanks for your PR.
This PR will be closed by bot because you already had 3 opened PRs, close or merge them before submitting a new one.
#12179 , #12213 , #12484

@sre-bot
Copy link
Contributor

sre-bot commented Sep 30, 2019

Thanks for your PR.
This PR will be closed by bot because you already had 3 opened PRs, close or merge them before submitting a new one.
#12179 , #12213 , #12484

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 30, 2019
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Oct 8, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@930b852). Click here to learn what that means.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #12503   +/-   ##
===========================================
  Coverage          ?   79.9454%           
===========================================
  Files             ?        460           
  Lines             ?     102989           
  Branches          ?          0           
===========================================
  Hits              ?      82335           
  Misses            ?      14687           
  Partials          ?       5967

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520 crazycs520 added the status/can-merge Indicates a PR has been approved by a committer. label Oct 8, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

Your auto merge job has been accepted, waiting for 12537

@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Oct 8, 2019

@crazycs520 merge failed.

@crazycs520 crazycs520 merged commit bf10a7a into pingcap:master Oct 8, 2019
@crazycs520 crazycs520 removed status/DNM status/LGT1 Indicates that a PR has LGTM 1. labels Oct 8, 2019
@crazycs520 crazycs520 added the status/LGT2 Indicates that a PR has LGTM 2. label Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants