-
Notifications
You must be signed in to change notification settings - Fork 180
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
TestMessageIndexTransactionStatusesProviderResponse_HappyPath test being flaky. #6862
Conversation
…ests to be stable because of txStatusesChan closing too soon
…pyPath tests to be stable because of txStatusesChan closing too soon" This reverts commit dfa54c0.
…eing flaky because of statusesChan closes to soon
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6862 +/- ##
==========================================
- Coverage 41.18% 41.17% -0.01%
==========================================
Files 2109 2109
Lines 185660 185664 +4
==========================================
- Hits 76467 76454 -13
- Misses 102782 102797 +15
- Partials 6411 6413 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
LGTM - thank you for the quick turnaround
% go test ./engine/access/rest/websockets/data_providers/... -testify.m ^TestMessageIndexTransactionStatusesProviderResponse_HappyPath$ -count 100
? github.com/onflow/flow-go/engine/access/rest/websockets/data_providers/mock [no test files]
ok github.com/onflow/flow-go/engine/access/rest/websockets/data_providers 1.107s
engine/access/rest/websockets/data_providers/transaction_statuses_provider_test.go
Outdated
Show resolved
Hide resolved
thanks for pointing this out. |
…tatusesProviderResponse_HappyPath-fix-flaky-test
Closes issue with
TestMessageIndexTransactionStatusesProviderResponse_HappyPath
test being flaky : #6850 (comment)The
txStatusesChan
channel is being closed after all data is sent in the separate goroutine. Depending on the exact timing of goroutines, the provider may detect the closed channel and call theErr
method to check for errors. If this happens after the test finishes or the expectations are incomplete, the mocked call toErr
may not be registered properly.Synchronized Goroutines by added a done channel to wait for the provider's Run method to finish before concluding the test.