-
Notifications
You must be signed in to change notification settings - Fork 22
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 network discovery & start Node asynchronously #648
Conversation
Codecov Report
@@ Coverage Diff @@
## v0.x.x #648 +/- ##
==========================================
+ Coverage 90.13% 90.21% +0.07%
==========================================
Files 62 62
Lines 4623 4648 +25
==========================================
+ Hits 4167 4193 +26
+ Misses 456 455 -1
Continue to review full report at Codecov.
|
The asynchronous start has managed to find a bug: https://github.com/bpfkorea/agora/pull/649/files |
d2041b1
to
1683f81
Compare
It will be used in a later test.
f294696
to
c8831a1
Compare
Otherwise using 'dtest=agora.test.Network dub test' will also run tests in agora.test.NetworkClient.d and agora.test.NetworkManager.d, because both partially match the string.
This allows the test-suite to start multiple nodes in parallel without waiting for the discovery phase of one node to complete before another node's discovery begins. Without this we cannot test network discovery properly due to a race condition: A.start() => calls B.getNetworkInfo() However B's network info will always be empty because B.start() was never called, because the main thread is stuck waiting for A.start() to return. Fixes bosagora#276
The network info was discarded instead of used. Fixes bosagora#647
c8831a1
to
7e69a41
Compare
@bpfkorea/core this is blocking other PRs. Could you please review? :) |
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 reviewed all the codes yesterday.
It looks good to me.
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
I'll be do merge when the CI test is over
this.network.discover(); | ||
|
||
bool isNominating () | ||
this.taskman.runTask( |
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.
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 saw that, but I think I left it in out of misunderstanding. I'll remove it in a fixup PR.
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.
Oh, I didn't see this in detail.
It was wrapped twice.
This fixes the network discovery issue #647. While creating a test-case I've realized that #276 is actually blocking the implementation of a test-case. So this PR includes two fixes.
Fixes #276
Fixes #647