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

*: fix TestWatcher #8812

Merged
merged 3 commits into from
Nov 18, 2024
Merged

*: fix TestWatcher #8812

merged 3 commits into from
Nov 18, 2024

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Nov 14, 2024

What problem does this PR solve?

Issue Number: Close #8549.

What is changed and how does it work?

Wait until the watcher finishes starting, then write the key.

Check List

Tests

  • Unit test

Release note

None.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 14, 2024
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.25%. Comparing base (40ae26c) to head (dc15361).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8812      +/-   ##
==========================================
+ Coverage   75.21%   75.25%   +0.04%     
==========================================
  Files         459      456       -3     
  Lines       71843    71608     -235     
==========================================
- Hits        54035    53887     -148     
+ Misses      14351    14295      -56     
+ Partials     3457     3426      -31     
Flag Coverage Δ
unittests 75.25% <ø> (+0.04%) ⬆️

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

@rleungx
Copy link
Member Author

rleungx commented Nov 14, 2024

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 14, 2024
Signed-off-by: Ryan Leung <[email protected]>
@rleungx
Copy link
Member Author

rleungx commented Nov 14, 2024

/hold cancel

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 14, 2024
@rleungx rleungx requested review from JmPotato and lhy1024 November 14, 2024 07:33
@@ -357,6 +356,8 @@ func TestWatcher(t *testing.T) {
},
},
}
// wait watch to start
time.Sleep(time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we replace it with something like testutil.Eventually?

Copy link
Member Author

Choose a reason for hiding this comment

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

seem we cannot get the watcher state outside

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I think for this case, sleep is enough.

Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 18, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Nov 18, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 added approved and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 18, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-18 07:02:51.046106819 +0000 UTC m=+858133.236975808: ☑️ agreed by okJiang.
  • 2024-11-18 07:35:42.967948663 +0000 UTC m=+860105.158817653: ☑️ agreed by lhy1024.

@ti-chi-bot ti-chi-bot bot merged commit 40fe83e into tikv:master Nov 18, 2024
25 checks passed
@rleungx rleungx deleted the fix-test-2024-33 branch November 18, 2024 08:14
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestWatcher is flaky
3 participants