-
Notifications
You must be signed in to change notification settings - Fork 15
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
Integration test for node selection (PR) #397
Conversation
6250586
to
3f792ea
Compare
3f792ea
to
bb5e2e6
Compare
c158843
to
577a0f2
Compare
78c7532
to
6557329
Compare
505581b
to
de9ea0d
Compare
Hey @deyanzz what's going on with this PR? It was opened a while ago but I'm not sure if it's complete/ready to review |
…Test. Signed-off-by: Deyan Zhekov <[email protected]>
de9ea0d
to
1abb56d
Compare
Yes, I was hanging around with this PR for too long. I was wondering how exactly to implement the algorithm for node selection. I was searching for a similar tests in the Java SDK, but I found only one test to change the network in ClientTest.java. Definitely, it's better to start a discussion in this PR to think about the best algorithm for node selection. |
The algorithm is already implemented in |
Signed-off-by: Deyan Zhekov <[email protected]>
@deyanzz are you good if I close this for now? |
Sorry for my late response. I'm preparing a commit, where will introduce a new test similar to setNetworkWorks from the Java SDK. Also, I've done some minor refactoring for |
Signed-off-by: Deyan Zhekov <[email protected]>
With commit 191d650 I moved all of the unit tests for min & max backoff time into Created new issue #522 to track missing integration test for node selection. |
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, but there should be some follow-up on these once the multi-node test setup is done.
ASSERT_NO_THROW(accountBalance_6 = AccountBalanceQuery().setAccountId(accountId_6).execute(client)); | ||
ASSERT_NO_THROW(accountBalance_7 = AccountBalanceQuery().setAccountId(accountId_7).execute(client)); | ||
} |
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 is fine for now but I think we should really try to enforce going forward that the integration tests do not communicate with previewnet/testnet/mainnet nodes, hence my previous comments about waiting for the multi-node setup to be complete. A user should be able to test locally with that set-up if they so desire, and seeing as how this test contains URLs for testnet consensus nodes, these tests would not pass.
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 totally agree with you - using hardcoded URLs in the integration tests is a bad practice.
Integration tests should communicate only with the local node and this approach should be used in all of the Hedera's SDKs.
For now I will suggest to add a new JSON config files containing all of the consensus nodes for mainnet / previewnet / test. I will track this change in #525.
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 don't think this is necessary as we should not be communicating with testnet nodes to begin with. We would add this JSON file ultimately to remove it when we get the multi-node setup integrated. I think we should leave it for now and then go through this again when we get the multi-node setup working.
Signed-off-by: Deyan Zhekov <[email protected]>
Signed-off-by: Deyan Zhekov <[email protected]>
Description:
Related issue(s):
Fixes: #167
Notes for reviewer:
Checklist