-
Notifications
You must be signed in to change notification settings - Fork 2k
[DX-3769] [CRE-1561] Fix found flakes #22133
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -718,13 +718,22 @@ func requestRandomnessAndAssertRandomWordsRequestedEvent( | |||||||||||
| require.NoError(t, err) | ||||||||||||
| backend.Commit() | ||||||||||||
|
|
||||||||||||
| iter, err := coordinator.FilterRandomWordsRequested(nil, nil, []*big.Int{subID}, nil) | ||||||||||||
| require.NoError(t, err, "could not filter RandomWordsRequested events") | ||||||||||||
|
|
||||||||||||
| var events []v22.RandomWordsRequested | ||||||||||||
| for iter.Next() { | ||||||||||||
| events = append(events, iter.Event()) | ||||||||||||
| } | ||||||||||||
| require.Eventually(t, func() bool { | ||||||||||||
| iter, err := coordinator.FilterRandomWordsRequested(nil, nil, []*big.Int{subID}, nil) | ||||||||||||
| if err != nil { | ||||||||||||
| return false | ||||||||||||
| } | ||||||||||||
| var batch []v22.RandomWordsRequested | ||||||||||||
| for iter.Next() { | ||||||||||||
| batch = append(batch, iter.Event()) | ||||||||||||
| } | ||||||||||||
|
||||||||||||
| } | |
| } | |
| if err := iter.Error(); err != nil { | |
| return false | |
| } |
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.
Ah true error check was missing
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.
FilterRandomWordsRequestedreturns aRandomWordsRequestedIteratorwith aClose()method; inside thisrequire.Eventuallyloop a new iterator is created on each poll but never closed. This can leak resources/goroutines across retries and make the test flaky. Ensure the iterator is closed on every attempt (including early-return paths), and handle anyClose()error appropriately.