-
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
*: fix data races in some other tests from TiFlash Cluster Manager #31832
Conversation
Signed-off-by: CalvinNeo <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/fac4a7db80abf12b1acd68ee6509e96154d9f25d |
ddl/ddl_tiflash_test.go
Outdated
ddl.PollTiFlashInterval.Store(1000 * time.Millisecond) | ||
ddl.PullTiFlashPdTick.Store(60) |
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.
I think moving these initializations to the beginning of SetUpSuite
should solve data race(because the DDL is not started). Then we don't need to use atomic
.
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.
I can move them to the beginning. However, these values will be modified in test cases which I think is in a goroutine other than DDL. I think it may also lead to some data race?
Signed-off-by: CalvinNeo <[email protected]>
ddl/ddl_tiflash_test.go
Outdated
@@ -60,6 +60,8 @@ const ( | |||
func (s *tiflashDDLTestSuite) SetUpSuite(c *C) { | |||
var err error | |||
|
|||
ddl.PollTiFlashInterval.Store(1000 * time.Millisecond) |
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.
PollTiFlashInterval
is now only set here and TearDownSuite
, could you remove the atomic way?
ddl/ddl_tiflash_test.go
Outdated
@@ -60,6 +60,8 @@ const ( | |||
func (s *tiflashDDLTestSuite) SetUpSuite(c *C) { | |||
var err error | |||
|
|||
ddl.PollTiFlashInterval.Store(1000 * time.Millisecond) |
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.
PollTiFlashInterval
is now only set here and TearDownSuite
, could you remove the atomic way?
Signed-off-by: CalvinNeo <[email protected]>
/run-unit-test |
/run-mysql-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 79e851f
|
Signed-off-by: CalvinNeo [email protected]
What problem does this PR solve?
Issue Number: close #31828 close #31829
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note