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

tests: add frequency check time to make resign test more stable #8411

Merged
merged 5 commits into from
Jul 19, 2024

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Jul 17, 2024

What problem does this PR solve?

tests: add frequency check time to make resign test more stable

--- FAIL: TestRegionStatistics (17.47s)
    cluster_test.go:262: 
        	Error Trace:	/home/runner/work/pd/pd/tests/server/cluster/cluster_test.go:262
        	Error:      	Should not be: "pd3"
        	Test:       	TestRegionStatistics

tikv/pd/actions/runs/9967757112/job/27541904077

Conclude: Because frequently change(There are many resign leader in this test and slow disk can make frequently happened in high probability :(

cluster_test.go:262 checks pd leader not be pd3, which means cluster.ResignLeader() regards pd3 is leader, but tc.WaitLeader() still get pd3

	leaderName = leaderServer.GetServer().Name()
	leaderServer.ResignLeader()
	re.NotEqual(tc.WaitLeader(), leaderName)

Let's check the log:

// now leader is pd3
[2024/07/17 03:38:56.625 +00:00] [INFO] [server.go:1737] ["campaign PD leader ok"] [campaign-leader-name=pd3]
[2024/07/17 03:38:57.143 +00:00] [INFO] [member.go:356] ["try to resign etcd leader to next pd-server"] [from=pd3] [to=]
// due to frequently transfer leader to pd3 as well
[2024/07/17 03:38:58.149 +00:00] [INFO] [member.go:356] ["try to resign etcd leader to next pd-server"] [from=pd2] [to=]
[2024/07/17 03:38:58.190 +00:00] [INFO] [server.go:1737] ["campaign PD leader ok"] [campaign-leader-name=pd3]
[2024/07/17 03:38:58.650 +00:00] [ERROR] [server.go:1717] ["campaign PD leader meets error due to etcd error"] [campaign-leader-name=pd2] [error="[PD:server:ErrLeaderFrequentlyChange]leader pd2 frequently changed, leader-key is [/pd/7392444153452143012/leader]"]

Issue Number: Close #8319, #8351

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

Release note

None.

@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 17, 2024
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.32%. Comparing base (c514937) to head (9f2ee7f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8411   +/-   ##
=======================================
  Coverage   77.31%   77.32%           
=======================================
  Files         471      471           
  Lines       61878    61882    +4     
=======================================
+ Hits        47840    47849    +9     
+ Misses      10466    10457    -9     
- Partials     3572     3576    +4     
Flag Coverage Δ
unittests 77.32% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@HuSharp HuSharp requested review from JmPotato and lhy1024 and removed request for JmPotato July 17, 2024 08:25
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 17, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 17, 2024

@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

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 kubernetes/test-infra repository.


// ChangeFrequencyTimes changes the frequency check times of campaign leader.
// ONLY used for test to make the test more stable.
// PLEASE flash back this value after using.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using failpoint here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Signed-off-by: husharp <[email protected]>
@ti-chi-bot ti-chi-bot bot added the lgtm label Jul 19, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, lhy1024, okJiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 19, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 19, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-17 08:28:39.428472197 +0000 UTC m=+428941.419413668: ☑️ agreed by lhy1024.
  • 2024-07-19 10:11:41.278971345 +0000 UTC m=+607923.269912815: ☑️ agreed by JmPotato.

@ti-chi-bot ti-chi-bot bot merged commit 8de0412 into tikv:master Jul 19, 2024
21 checks passed
@HuSharp HuSharp deleted the make_resign_stable branch July 20, 2024 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestRegionStatistics is unstable
4 participants