-
Notifications
You must be signed in to change notification settings - Fork 143
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 the canonical chain is deleted #675
Conversation
Codecov Report
@@ Coverage Diff @@
## master #675 +/- ##
==========================================
+ Coverage 87.33% 87.34% +0.01%
==========================================
Files 218 218
Lines 17760 17781 +21
==========================================
+ Hits 15510 15531 +21
- Misses 1187 1192 +5
+ Partials 1063 1058 -5
|
Libplanet.Tests/Net/SwarmTest.cs
Outdated
await BootstrapAsync(swarmA, swarmB.AsPeer); | ||
|
||
swarmA.BroadcastBlocks(new[] { block }); | ||
await Task.Delay(100); |
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.
This scenario seems likely to make the test flaky, because swarmA.BroadcastBlocks(new[] { block })
could be faster than we assume… how about watching chainB.TipChanged
event instead?
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.
Unfortunately, we can't use the TipChanged
event because block downloading should be failed before block appending is complete.
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.
Could we make a new event to test this then?
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.
I added Swarm<T>. FillBlocksAsyncFailed
for this test case.
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
bd35912
to
7997905
Compare
Co-Authored-By: Hong Minhee <hong.minhee@gmail.com>
7997905
to
0bb5b95
Compare
This fixed a bug where the canonical chain would be deleted if block download failed.