-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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 flaky periodic tests #17586
Fix flaky periodic tests #17586
Conversation
Hi @dusk125. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
Signed-off-by: Allen Ray <[email protected]>
@ahrtr ptal |
Hi @dusk125 I am trying the same code in my local and run with used the command also this have some overlap with this PR #17513, the discussion there might be helpful |
func NewRecorderSync() Recorder { | ||
return &recorderSync{ch: make(chan Action)} | ||
} | ||
|
||
func (r *recorderSync) Record(a Action) { | ||
r.ch <- a | ||
} | ||
|
||
func (r *recorderSync) Action() (acts []Action) { | ||
for { | ||
select { | ||
case act := <-r.ch: | ||
acts = append(acts, act) | ||
default: | ||
return acts | ||
} | ||
} | ||
} | ||
|
||
func (r *recorderSync) Chan() <-chan Action { | ||
return r.ch | ||
} |
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.
The implementation is identical to recorderStream
.
func (r *recorderSync) Wait(n int) ([]Action, error) { | ||
acts := make([]Action, 0, n) | ||
for i := 0; i < n; i++ { | ||
acts = append(acts, <-r.ch) | ||
} | ||
return acts, nil | ||
} |
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.
The implementation in #17513 can also resolve this by setting an unlimited timeout.
Thanks for the fix, but Overall I prefer to #17513 over this PR. |
No problem, we can go with #17513 ! |
Addresses #17391
Removes the need to timeout in real-time by using the
clockwork.FakeClock.BlockUtil
function to wait for the Periodic compactor to get to the Retry "After" step.