-
Notifications
You must be signed in to change notification settings - Fork 6
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 test #23
Fix flaky test #23
Conversation
assert.NotNil(t, res) | ||
} | ||
|
||
func TestNewBlockListenerOKNotStopImmediately(t *testing.T) { |
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.
Thanks for the PR!
Let's call it 'WithDelay' or something like that)
} | ||
|
||
res, _, err := c.NewBlockListener(ctx, req) | ||
done() |
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.
Let's use 'defer done()' instead (at line 17) to be sure, that it was closed
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.
Actually the idea of this fix is moving done here that don't wait additional asserts execution as it was for done for example TestBlockListenerStartGettingHighestBlockRetry. If you compare with the test below the difference is that we just slightly increased time of execution 1 sec + asserts time of execution before done() will be executed and as a result MonitorBlockHeader is executed.
As for point to be sure, that it was closed
since this is test and its behaviour should be deterministic so we know that no errors for it then done() should be executed as well.
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.
See that the test was failed again so let's remove it - coverage can't be decreased. Let's monitor it with verbose option we should see more details
Codecov Report
@@ Coverage Diff @@
## main #23 +/- ##
==========================================
+ Coverage 46.10% 47.85% +1.74%
==========================================
Files 22 22
Lines 861 861
==========================================
+ Hits 397 412 +15
+ Misses 459 444 -15
Partials 5 5 |
Signed-off-by: Alexey Semenyuk <[email protected]>
Build is failed time to time due test https://github.com/hyperledger/firefly-tezosconnect/actions/runs/6794181484/job/18470172130