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

TestAnalyzeGlobalStatsWithOpts2 test failed #24679

Closed
Tracked by #25899
disksing opened this issue May 17, 2021 · 16 comments · Fixed by #25487, #26921 or #27430
Closed
Tracked by #25899

TestAnalyzeGlobalStatsWithOpts2 test failed #24679

disksing opened this issue May 17, 2021 · 16 comments · Fixed by #25487, #26921 or #27430
Assignees
Labels
component/test severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@disksing
Copy link
Contributor

Bug Report

CI failure:

[2021-05-17T05:39:17.831Z] FAIL: handle_test.go:864: testStatsSuite.TestAnalyzeGlobalStatsWithOpts2
[2021-05-17T05:39:17.831Z] 
[2021-05-17T05:39:17.831Z] handle_test.go:872:
[2021-05-17T05:39:17.831Z]     s.checkForGlobalStatsWithOpts(c, tk, "p1", 20, 50)
[2021-05-17T05:39:17.831Z] handle_test.go:820:
[2021-05-17T05:39:17.831Z]     c.Assert(len(tk.MustQuery(fmt.Sprintf("show stats_topn where partition_name='%v' and is_index=%v", p, isIdx)).Rows()), Equals, topn)
[2021-05-17T05:39:17.831Z] ... obtained int = 0
[2021-05-17T05:39:17.831Z] ... expected int = 20
@qw4990
Copy link
Contributor

qw4990 commented Jun 1, 2021

I'm working on this Now, and since this issue only affects our test case, I degrade its severity to moderate.

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

@zhouqiang-cl
Copy link
Contributor

happend again in https://ci.pingcap.net/blue/rest/organizations/jenkins/pipelines/tidb_ghpr_check_2/runs/22461/nodes/62/steps/73/log/?start=0

21-08-03T09:00:47.221Z] 
[2021-08-03T09:00:47.221Z] ----------------------------------------------------------------------
[2021-08-03T09:00:47.221Z] FAIL: handle_test.go:955: testStatsSuite.TestAnalyzeGlobalStatsWithOpts2
[2021-08-03T09:00:47.221Z] 
[2021-08-03T09:00:47.221Z] handle_test.go:966:
[2021-08-03T09:00:47.221Z]     s.checkForGlobalStatsWithOpts(c, tk, "p1", 1, 50)
[2021-08-03T09:00:47.221Z] handle_test.go:911:
[2021-08-03T09:00:47.221Z]     // since the hist-building algorithm doesn't stipulate the final bucket number to be equal to the expected number exactly,
[2021-08-03T09:00:47.221Z]     // we have to check the results by a range here.
[2021-08-03T09:00:47.221Z]     c.Assert(numBuckets >= buckets-delta, IsTrue)
[2021-08-03T09:00:47.221Z] ... obtained bool = false
[2021-08-03T09:00:47.221Z] 

@zhouqiang-cl
Copy link
Contributor

@zhouqiang-cl zhouqiang-cl reopened this Aug 11, 2021
@zhouqiang-cl
Copy link
Contributor

@disksing
Copy link
Contributor Author

/cc @qw4990

@zhouqiang-cl
Copy link
Contributor

@tisonkun
Copy link
Contributor

another instance

[2021-09-09T08:51:25.713Z] FAIL: handle_test.go:956: testSerialStatsSuite.TestAnalyzeGlobalStatsWithOpts2
[2021-09-09T08:51:25.713Z] 
[2021-09-09T08:51:25.713Z] handle_test.go:967:
[2021-09-09T08:51:25.713Z]     s.checkForGlobalStatsWithOpts(c, tk, "test_gstats_opt2", "p1", 1, 50)
[2021-09-09T08:51:25.713Z] handle_test.go:912:
[2021-09-09T08:51:25.713Z]     // since the hist-building algorithm doesn't stipulate the final bucket number to be equal to the expected number exactly,
[2021-09-09T08:51:25.713Z]     // we have to check the results by a range here.
[2021-09-09T08:51:25.713Z]     c.Assert(numBuckets, GreaterEqual, buckets-delta)
[2021-09-09T08:51:25.713Z] ... compare_one int = 0
[2021-09-09T08:51:25.713Z] ... compare_two int = 15

https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_check_2/detail/tidb_ghpr_check_2/32359/pipeline

@unconsolable
Copy link
Contributor

another occurrence

[2021-10-07T10:49:44.112Z] FAIL: handle_test.go:956: testSerialStatsSuite.TestAnalyzeGlobalStatsWithOpts2
[2021-10-07T10:49:44.112Z] 
[2021-10-07T10:49:44.112Z] handle_test.go:965:
[2021-10-07T10:49:44.112Z]     s.checkForGlobalStatsWithOpts(c, tk, "test_gstats_opt2", "global", 2, 50)
[2021-10-07T10:49:44.112Z] handle_test.go:908:
[2021-10-07T10:49:44.112Z]     c.Assert(len(tk.MustQuery(fmt.Sprintf("show stats_topn where table_name='%v' and partition_name='%v' and is_index=%v", t, p, isIdx)).Rows()), Equals, topn)
[2021-10-07T10:49:44.112Z] ... obtained int = 20
[2021-10-07T10:49:44.112Z] ... expected int = 2
[2021-10-07T10:49:44.112Z] 
[2021-10-07T10:49:44.112Z] OOPS: 113 passed, 1 skipped, 1 FAILED

https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_check_2/detail/tidb_ghpr_check_2/36982/pipeline

@Zh1Cheung
Copy link
Contributor

@unconsolable
Copy link
Contributor

another occurrence
https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_check_2/detail/tidb_ghpr_check_2/41728/pipeline

[2021-10-29T08:44:08.852Z] FAIL: handle_test.go:957: testSerialStatsSuite.TestAnalyzeGlobalStatsWithOpts2
[2021-10-29T08:44:08.852Z] 
[2021-10-29T08:44:08.852Z] handle_test.go:968:
[2021-10-29T08:44:08.852Z]     s.checkForGlobalStatsWithOpts(c, tk, "test_gstats_opt2", "p1", 1, 50)
[2021-10-29T08:44:08.852Z] handle_test.go:913:
[2021-10-29T08:44:08.852Z]     // since the hist-building algorithm doesn't stipulate the final bucket number to be equal to the expected number exactly,
[2021-10-29T08:44:08.852Z]     // we have to check the results by a range here.
[2021-10-29T08:44:08.852Z]     c.Assert(numBuckets, GreaterEqual, buckets-delta)
[2021-10-29T08:44:08.852Z] ... compare_one int = 0
[2021-10-29T08:44:08.852Z] ... compare_two int = 15

@clovis1122
Copy link
Contributor

@aytrack
Copy link
Contributor

aytrack commented Nov 22, 2021

happened again in ci:https://ci.pingcap.net/blue/organizations/jenkins/tidb_ghpr_coverage/detail/tidb_ghpr_coverage/1265/pipeline

[2021-11-20T04:37:01.401Z] FAIL: handle_test.go:960: testSerialStatsSuite.TestAnalyzeGlobalStatsWithOpts2

[2021-11-20T04:37:01.401Z] 

[2021-11-20T04:37:01.401Z] handle_test.go:971:

[2021-11-20T04:37:01.401Z]     s.checkForGlobalStatsWithOpts(c, tk, "test_gstats_opt2", "p1", 1, 50)

[2021-11-20T04:37:01.401Z] handle_test.go:916:

[2021-11-20T04:37:01.401Z]     // since the hist-building algorithm doesn't stipulate the final bucket number to be equal to the expected number exactly,

[2021-11-20T04:37:01.401Z]     // we have to check the results by a range here.

[2021-11-20T04:37:01.401Z]     c.Assert(numBuckets, GreaterEqual, buckets-delta)

[2021-11-20T04:37:01.401Z] ... compare_one int = 0

[2021-11-20T04:37:01.401Z] ... compare_two int = 15

[2021-11-20T04:37:01.401Z] 

@tiancaiamao
Copy link
Contributor

This test is unstable by itself, if you run it several times, it may success or fail!

@tisonkun
Copy link
Contributor

@tiancaiamao what's the expectation of the functionality? I don't think it's reasonable writing something indeterminate with determinate tests.

@tisonkun
Copy link
Contributor

tisonkun commented Feb 21, 2022

Closed as skipped and not bring back yet. We can have a new issue discussing how to write the test correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment