statistics: add tests for global-stats when add and delete a single partition#23256
statistics: add tests for global-stats when add and delete a single partition#23256qw4990 merged 14 commits intopingcap:masterfrom
Conversation
| DecodeCMSketchAndTopN([]byte{}, rows) | ||
| } | ||
|
|
||
| func (s *testStatisticsSuite) TestMergeTopN(c *C) { |
There was a problem hiding this comment.
If we change here to serial test. It will cause the import cycle.
| c.Assert(subtraction(newNum, oldNum), Equals, 20) | ||
| } | ||
|
|
||
| func (s *testSerialStatsSuite) TestMergeTopN(c *C) { |
There was a problem hiding this comment.
Just copy from the origin implementation.
| return | ||
| } | ||
| globalTableInfo := globalTable.Meta() | ||
| partitionNum := globalTableInfo.Partition.Num |
There was a problem hiding this comment.
The globalTableInfo.Partition.Num do not record the added partitions. So we should use the len(globalTableInfo.Partition.Definitions) to replace it.
| */ | ||
| } | ||
|
|
||
| func (s *testSerialSuite2) TestFastAnalyze4GlobalStats(c *C) { |
There was a problem hiding this comment.
Fix the unstable test.
statistics/handle/handle_test.go
Outdated
| // We did not analyze partition p1, so the value here has not changed | ||
| c.Assert(globalStats.Count, Equals, int64(7)) | ||
|
|
||
| tk.MustExec("analyze table t;") |
There was a problem hiding this comment.
Please only analyze p1 here since p0 and p2 are already up-to-date, and then check if the global.count is 9.
|
[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. DetailsReviewer can indicate their review by writing |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 666ee02 |
|
/run-tics-test |
|
/run-all-tests |
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
TestCMSketchCodingTopNWhat is changed and how it works?
statistics/cmsketch_test.goandstatistics/statistics_test.goare used to avoid the race test.Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Release note