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

TestMessageIndexTransactionStatusesProviderResponse_HappyPath test being flaky. #6862

Conversation

AndriiDiachuk
Copy link
Contributor

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 the Err method to check for errors. If this happens after the test finishes or the expectations are incomplete, the mocked call to Err 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.

…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-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.17%. Comparing base (47f24e9) to head (c240451).
Report is 9 commits behind head on master.

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     
Flag Coverage Δ
unittests 41.17% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jordanschalm jordanschalm left a 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

@jordanschalm jordanschalm added this pull request to the merge queue Jan 9, 2025
@AndriiDiachuk
Copy link
Contributor Author

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

thanks for pointing this out.

@AndriiDiachuk AndriiDiachuk removed this pull request from the merge queue due to a manual request Jan 9, 2025
…tatusesProviderResponse_HappyPath-fix-flaky-test
@AndriiDiachuk AndriiDiachuk added this pull request to the merge queue Jan 9, 2025
Merged via the queue into onflow:master with commit c6a1f97 Jan 9, 2025
56 checks passed
@AndriiDiachuk AndriiDiachuk deleted the AndriiDiachuk/TestMessageIndexTransactionStatusesProviderResponse_HappyPath-fix-flaky-test branch January 9, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants