-
Notifications
You must be signed in to change notification settings - Fork 366
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
INDY-1911: add integration tests #1034
INDY-1911: add integration tests #1034
Conversation
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
test this please |
ensure_all_nodes_have_same_data(looper, nodes=txnPoolNodeSet) | ||
|
||
for node in txnPoolNodeSet: | ||
assert node.viewNo == view_no |
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.
Since we are already relying in this test on a fact that view change starts on some nodes I think it's better to do something like this:
assert node.viewNo == view_no | |
assert node.viewNo > view_no |
Another option is to just get rid of this check, since actually all that we want here is to check that nodes will eventually come to consensus after some panics and restarts, and this is already done by ensureElectionsDone
and ensure_all_nodes_have_same_data
.
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.
Done
nodes_to_restart = txnPoolNodeSet[1:3] | ||
|
||
# waiting to discard InstanceChange | ||
looper.runFor(tconf.OUTDATED_INSTANCE_CHANGES_CHECK_INTERVAL) |
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.
Probably it's better to wait for a little bit more than timeout interval:
looper.runFor(tconf.OUTDATED_INSTANCE_CHANGES_CHECK_INTERVAL) | |
looper.runFor(tconf.OUTDATED_INSTANCE_CHANGES_CHECK_INTERVAL +1) |
Another option (although a bit more intrusive) is to actually wait until nodes don't have INSTANCE_CHANGE from panic_node
anymore.
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.
Change to wait INSTANCE_CHANGE removing
def check(): | ||
assert all(panic_node.view_changer.instanceChanges.has_inst_chng_from(view_no + 1, node.name) | ||
for node in nodes_to_restart) | ||
assert not panic_node.view_changer.instanceChanges.has_inst_chng_from(view_no + 1, panic_node.name) |
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.
Second assert looks a bit excessive here. Also in first assert it might make sense to actually check that all nodes received instance changes from nodes_to_restart
, not just panic_node
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.
In the second assert we check that panic_node hasn't InstanceChange from itself.
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.
Remove this assert because added this check before nodes restarting
looper.removeProdable(name=node_to_disconnect.name) | ||
|
||
# add node_to_disconnect to pool | ||
node_to_disconnect = start_stopped_node(node_to_disconnect, looper, tconf, |
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.
Are we sure that this is enough to clear state of node_to_disconnect
?
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.
Yes, beacause start_stopped_node create a new TestNode
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar renata.toktar@dsr-corporation.com