-
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
statistics: migrate test-infra to testify for statistics_test.go #28558
Conversation
[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. |
ci failed due to
|
2aa83ad
to
1947b4f
Compare
ci fails due to #27889
|
/run-check_dev_2 |
/cc @tisonkun |
notice the last commit add an useless line to workaround for tools/check/check_testSuite.sh |
Rename the suite could work, let me try to push a follow up for you to resolve conflict as well as workaround this check |
@feitian124 but you should keep |
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.
Could you elaborate how you determinate serial tests? That is, how you decide a test should be run in serial or in parallel.
check the first commit, you can find there are 2 suites, one is |
@feitian124 I don't find one. Do you mix it up with #28693 ? I find all tests under |
var _ = check.Suite(&testStatisticsSuite{}) | ||
|
||
func TestT(t *testing.T) { | ||
config.UpdateGlobal(func(conf *config.Config) { |
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.
config.UpdateGlobal
part i had added in TestStatistics, please check.
add here is package
level, add in TestStatistics is more adhere to origin suite
scope.
but in my memory some other tests also has config.UpdateGlobal
, not sure if package
level is better.
and could you explain why it need config.UpdateGlobal
, not quit understand.
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.
It is not package
level, but TestT
level. But since we only had one TestT
, it becomes global/package level.
This function itself it to avoid race, but it does not always work.
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.
thanks, get it, TestingT
is a special function in pingcap/check
package, which runs all test suites registered with the Suite function.
as almost all original tests were suite based, i think make it active for all tests in this package is reasonable.
i will mv it to TestMain.
Thanks for your updating @feitian124 ! I'm reviewing now. |
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.
ping @winoros please take a look.
/cc @rebelice Could you please take a look at this PR? |
/cc @winoros @xhebox @tiancaiamao sorry for disturb as seems they are busy, could you help review? |
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.
Rest LGTM
var _ = check.Suite(&testStatisticsSuite{}) | ||
|
||
func TestT(t *testing.T) { | ||
config.UpdateGlobal(func(conf *config.Config) { |
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.
It is not package
level, but TestT
level. But since we only had one TestT
, it becomes global/package level.
This function itself it to avoid race, but it does not always work.
statistics/main_test.go
Outdated
@@ -30,8 +29,6 @@ import ( | |||
"go.uber.org/goleak" | |||
) | |||
|
|||
var _ = check.Suite(&testStatisticsSuite{}) |
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.
this line is here since that time other tests like cmsketch_test.go
did not migrate so need it.
now #28552 is merged so ok to delete.
but after delete, will lead to suite not used
error, so i renamed the old struct name from testStatisticsSuite
to testStatisticsSamples
to avoid it.
updated as your suggestion, please review agian, thanks. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7402844
|
@feitian124: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #28123
notice: serial tests and their helper methods moved to statistics_serial_test.go
Release note