-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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 TestModifyColumnNullToNotNull
test stable
#13223
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13223 +/- ##
===========================================
Coverage 80.1406% 80.1406%
===========================================
Files 469 469
Lines 111323 111323
===========================================
Hits 89215 89215
Misses 15217 15217
Partials 6891 6891 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ddl/db_test.go
Outdated
@@ -2725,18 +2723,18 @@ func (s *testDBSuite1) TestModifyColumnNullToNotNull(c *C) { | |||
} | |||
c2 := getModifyColumn() | |||
if mysql.HasPreventNullInsertFlag(c2.Flag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this check? I think c2.Flag
always HasPreventNullInsertFlag
in this place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, it's not necessary.
5a6a696
to
4352e04
Compare
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
This PR tries to fix a potentially failed assertion that makes TiDB unit test keep hanging and failed because of timeout.
What is changed and how it works?
The code:
tidb/ddl/db_test.go
Line 2706 in 1b72ce5
in
TestModifyColumnNullToNotNull
has following flaws:t1
, in which leads a potentialinformation schema is changed
error.MustExec
failed, only ddl worker goroutine exits, which leaves ddl job never ends.This PR removes
MustExec
and does the make outside ofhook
, while changing the time of hook called to avoidinformation schema is changed
error.PS: There are still some other codes that use assertion inside of
hook
in ddl tests, we should refine them all to avoid similar timeout failures, I plan to do the refinements later.Check List
Tests
Code changes
Side effects
Related changes
Release note