-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 pluginwatcher flake #20212
Fix pluginwatcher flake #20212
Conversation
@@ -212,6 +212,7 @@ func TestExamplePlugin(t *testing.T) { | |||
func waitForPluginRegistrationStatus(t *testing.T, statusCh chan registerapi.RegistrationStatus) bool { | |||
select { | |||
case status := <-statusCh: | |||
time.Sleep(time.Millisecond) |
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 is still flake prone at load. If a sleep is needed, sleep for longer.
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.
increased to 1 sec, i think it should be enough.
6c1f010
to
ce40dee
Compare
@vikaschoudhary16 please make the commit msg |
ce40dee
to
7d5bea8
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, sjenning, vikaschoudhary16 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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
Package is now flaking with:
|
Sorry, my mistake. Did not retest after increasing timeout from 1 ms to 1 sec. Missed to notice that timeout duration for plugin stop is also 1 sec and therefore it started flaking, which is obvious. |
This is a stopgap(temporary) fix for the flake, #20136
This part has got changed recently, and this issue is not there at upstream kube. This PR,kubernetes/kubernetes#65662, is cherry-picking the changed part to kube 1.11.
Meanwhile this fix will help avoiding this flake.
Implementation of
NotifyRegistrationStatus
RPC at example plugin is writing registration status to a channel that unit test is listening on. Unit test after receving data on this channel, stops the example plugin server. Here is a race. Sometimes plugin server gets closed beforeNotifyRegistrationStatus
could return and thus showing error on client (plugin watcher), which if being verified in the unit test.Fix: With this 1 ms delay, plugin server is not getting closed before RPC return.
WIthout this fix, issue is happening at my local machine with this cmd:
After this fix, following is also working:
UPDATE: Increased sleep time to 1 sec
/cc @sjenning @liggitt