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 flaky periodic tests #17586

Closed
wants to merge 1 commit into from
Closed

Fix flaky periodic tests #17586

wants to merge 1 commit into from

Conversation

dusk125
Copy link
Contributor

@dusk125 dusk125 commented Mar 14, 2024

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.

@k8s-ci-robot
Copy link

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@jmhbnz
Copy link
Member

jmhbnz commented Mar 15, 2024

/ok-to-test

Signed-off-by: Allen Ray <alray@redhat.com>
@dusk125
Copy link
Contributor Author

dusk125 commented Mar 19, 2024

@ahrtr ptal

@qincwang
Copy link

qincwang commented Mar 22, 2024

Hi @dusk125 I am trying the same code in my local and run with stress to test flakiness, get this log after goroutine panic, the compaction succeeds and logs look legit though. could you please verify from your end, thank you
image

used the command
go run golang.org/x/tools/cmd/stress -p=8 ./v3compactor.test -test.run "^TestPeriodicPause$"

also this have some overlap with this PR #17513, the discussion there might be helpful

@ahrtr
Copy link
Member

ahrtr commented Mar 24, 2024

Sorry for the late response. @dusk125 could you respond to @qincwang 's comment above?

Please rebase this PR (we merges lots of PR recently), I will take a closer look at this PR sometime next week.

Comment on lines +145 to +166
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
}
Copy link
Member

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.

Comment on lines +168 to +174
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
}
Copy link
Member

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.

@ahrtr
Copy link
Member

ahrtr commented Mar 25, 2024

Thanks for the fix, but Overall I prefer to #17513 over this PR.

@dusk125
Copy link
Contributor Author

dusk125 commented Mar 28, 2024

No problem, we can go with #17513 !

@dusk125 dusk125 closed this Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants