Skip to content
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-1209] Raise node_request and pool_transactions fixtures and helper functions #579

Merged
merged 66 commits into from
Mar 29, 2018

Conversation

ArtObr
Copy link
Contributor

@ArtObr ArtObr commented Mar 21, 2018

No description provided.

ArtObr added 30 commits March 7, 2018 10:50
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
…t_state_proof; problem with wrong bls keys

Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
@ArtObr ArtObr changed the title [INDY-1209] Raise node_request and pool_transactions fixtures and helper functions [INDY-1209] Raise node_request and pool_transactions fixtures and helper functions [skip ci] Mar 26, 2018
@ArtObr
Copy link
Contributor Author

ArtObr commented Mar 26, 2018

Test this please

@ArtObr ArtObr changed the title [INDY-1209] Raise node_request and pool_transactions fixtures and helper functions [skip ci] [INDY-1209] Raise node_request and pool_transactions fixtures and helper functions Mar 26, 2018
@ArtObr
Copy link
Contributor Author

ArtObr commented Mar 26, 2018

Test this please

@ArtObr ArtObr changed the title [INDY-1209] Raise node_request and pool_transactions fixtures and helper functions [INDY-1209] Raise node_request and pool_transactions fixtures and helper functions [skip ci] Mar 26, 2018
new_steward_name, new_node_name, tdir, tconf, nodeClass=testNodeClass,
allPluginsPath=allPluginsPath, autoStart=True,
do_post_node_creation=do_post_node_creation)
yield looper, new_node, sdk_pool_handle, new_steward_wallet_handle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pool refresh is not called here but pool handle is returned
it should be fixed

sdk_node_created_after_some_txns
txnPoolNodeSet.append(new_node)
looper.run(checkNodesConnected(txnPoolNodeSet))
return looper, new_node, sdk_pool_handle, new_steward_wallet_handle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pool refresh is not called here but pool handle is returned
it should be fixed

@@ -60,7 +75,8 @@ def testCatchupDelayedNodes(txnPoolNodeSet, nodeSetWithNodeAddedAfterSomeTxns,
nodeX.stop()
nodeY.stop()
logger.debug("Sending requests")
sendReqsToNodesAndVerifySuffReplies(looper, wallet, client, 50)
sdk_send_random_and_check(looper, txnPoolNodeSet, sdk_pool_handle,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pool refresh is not called before pool handle usage

fix it here and in all "add node tests" below

@@ -43,7 +43,7 @@ def pre_check(tconf, looper, txnPoolNodeSet, tdirWithClientPoolTxns,
looper.add(client)
looper.run(client.ensureConnectedToNodes())
for i in range(tconf.ProcessedBatchMapsToKeep - 1):
sendReqsToNodesAndVerifySuffReplies(looper, wallet, client, 1)
sendReqsToNodesAndVerifySuffReplies(looper, wallet, client, 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you forget to change it?

ArtObr added 2 commits March 27, 2018 16:06
…al, NodeSetWithNodeAddedAfterSomeTxns, nodeCreatedAfterSomeTxns, newNodeCaughtUp.

Signed-off-by: ArtObr <[email protected]>
@ArtObr ArtObr changed the title [INDY-1209] Raise node_request and pool_transactions fixtures and helper functions [skip ci] [INDY-1209] Raise node_request and pool_transactions fixtures and helper functions Mar 27, 2018
@ArtObr
Copy link
Contributor Author

ArtObr commented Mar 27, 2018

Test this please

1 similar comment
@ArtObr
Copy link
Contributor Author

ArtObr commented Mar 27, 2018

Test this please

ArtObr added 3 commits March 28, 2018 08:06
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>
Signed-off-by: ArtObr <[email protected]>

logger.info("3. send more requests, "
"so that the new node's state is outdated")
sendReqsToNodesAndVerifySuffReplies(looper, wallet, client, 5)
checkNodeDataForInequality(newNode, *txnPoolNodeSet[:-1])
sdk_send_random_and_check(looper, txnPoolNodeSet, sdk_pool_handle,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no pool refresh after node update

add pool refresh to the end of sdk_send_update_node func, i.e. inside the func

tdir, tdirWithClientPoolTxns, tconf, nodeClass=testNodeClass,
new_steward_name = randomString()
new_node_name = "Epsilon"
new_steward_wallet_handle, new_node = sdk_add_new_steward_and_node(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add pool refresh after the call

from plenum.test.pool_transactions.helper import \
disconnect_node_and_ensure_disconnected
from plenum.test.test_node import ensureElectionsDone, getRequiredInstances
from plenum.test.view_change.helper import start_stopped_node

TestRunningTimeLimitSec = 200
TestRunningTimeLimitSec = 400
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add TODO with something like "restore back after sdk will have api call to change its timeout"

@@ -86,9 +92,10 @@ def test_plugin_dynamic_validation(txn_pool_node_set_post_creation, looper, stew
successful_op(looper, op, sdk_wallet_steward, sdk_pool_handle)


# TODO: probably delete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to delete it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses sdk requests sends and in the same time take value of defaultId from stewardWallet. So i thought that this is check related to the old client things. Also, it have only 2 usage as a fixture.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to rewrite it and remove the comment

@@ -45,7 +44,7 @@ def testStewardSuspendsNode(looper, txnPoolNodeSet,
looper.run(eventually(checkNodeNotInNodeReg, client, newNode.name))

# Check a client can send request and receive replies
req = sendRandomRequest(newStewardWallet, newSteward)
# req = sendRandomRequest(newStewardWallet, newSteward)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did comment this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause i think that this test will never be unskip (: (it was skipped 02.17)

@@ -1,58 +0,0 @@
from plenum.common.types import f
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not delete this test and file
Rewrite it

client,
numRequests,
fVal)
# sendReqsToNodesAndVerifySuffReplies(txnPoolNodesLooper,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comments

@@ -41,19 +40,14 @@ def catchuped(node):
assert node.mode == Mode.participating


def add_new_node(looper, nodes, steward, steward_wallet,
def add_new_node(looper, nodes, sdk_pool_handle, sdk_wallet_steward,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add pool refresh to this func

Signed-off-by: ArtObr <[email protected]>
@@ -86,9 +92,10 @@ def test_plugin_dynamic_validation(txn_pool_node_set_post_creation, looper, stew
successful_op(looper, op, sdk_wallet_steward, sdk_pool_handle)


# TODO: probably delete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to rewrite it and remove the comment

@ashcherbakov ashcherbakov merged commit e91be80 into hyperledger:master Mar 29, 2018
lampkin-diet pushed a commit to lampkin-diet/indy-plenum that referenced this pull request Apr 9, 2018
…per functions (hyperledger#579)

* Initial test integration

Signed-off-by: ArtObr <[email protected]>

* Two more files done

Signed-off-by: ArtObr <[email protected]>

* new test

Signed-off-by: ArtObr <[email protected]>

* 4 more folders done

Signed-off-by: ArtObr <[email protected]>

* two more files

Signed-off-by: ArtObr <[email protected]>

* some changes

Signed-off-by: ArtObr <[email protected]>

* More tests integrated. Problems: validator functions of client in test_state_proof; problem with wrong bls keys

Signed-off-by: ArtObr <[email protected]>

* Initial commit

Signed-off-by: ArtObr <[email protected]>

* Script fix. bls validation fix

Signed-off-by: ArtObr <[email protected]>

* more changes

Signed-off-by: ArtObr <[email protected]>

* little fix

Signed-off-by: ArtObr <[email protected]>

* Fix for bls validation tests. Not done: update_incorrect test and state_proof test

Signed-off-by: ArtObr <[email protected]>

* Only state_proof test left

Signed-off-by: ArtObr <[email protected]>

* Tests integration done

Signed-off-by: ArtObr <[email protected]>

* Deletion of Client1Connected. More test fix

Signed-off-by: ArtObr <[email protected]>

* Import deletion. flake8 error fix.

Signed-off-by: ArtObr <[email protected]>

* More changes to txnPoolNodeSet

Signed-off-by: ArtObr <[email protected]>

* Changes in tests

Signed-off-by: ArtObr <[email protected]>

* Remove pf TestNodeSet. Change of helper methods. Part 1.

Signed-off-by: ArtObr <[email protected]>

* Remove TestNodeSet from helper. part 2

Signed-off-by: ArtObr <[email protected]>

* More tests integrated

Signed-off-by: ArtObr <[email protected]>

* Functions fixes.

Signed-off-by: ArtObr <[email protected]>

* Fix for genesis txns

Signed-off-by: ArtObr <[email protected]>

* More tests integrated

Signed-off-by: ArtObr <[email protected]>

* primary_selection dependency fix

Signed-off-by: ArtObr <[email protected]>

* Fixture fix for view_change

Signed-off-by: ArtObr <[email protected]>

* View change test fix

Signed-off-by: ArtObr <[email protected]>

* Skips for merkle proof tests

Signed-off-by: ArtObr <[email protected]>

* Skips for merkle proof tests

Signed-off-by: ArtObr <[email protected]>

* Remove sendRandomRequest of old client. Part 1.

Signed-off-by: ArtObr <[email protected]>

* Review changes

Signed-off-by: ArtObr <[email protected]>

* Review changes

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequest. Part 2.

Signed-off-by: ArtObr <[email protected]>

* Little error fix

Signed-off-by: ArtObr <[email protected]>

* waitReqNackFromPoolWithReason function deletion

Signed-off-by: ArtObr <[email protected]>

* waitRejectFromPoolWithReason function deletion

Signed-off-by: ArtObr <[email protected]>

* checkReqNack function deletion

Signed-off-by: ArtObr <[email protected]>

* Two more fucntions deletion

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequests. Part 1.

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequests. Part 2. send_reqs_to_nodes_and_verify_all_replies deleted.

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequests. Part 3.

Signed-off-by: ArtObr <[email protected]>

* Little fix

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequest. Part 4.

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequests. Part 5. Deleted: ensure_pool_functional, NodeSetWithNodeAddedAfterSomeTxns, nodeCreatedAfterSomeTxns, newNodeCaughtUp.

Signed-off-by: ArtObr <[email protected]>

* little fix

Signed-off-by: ArtObr <[email protected]>

* little fix

Signed-off-by: ArtObr <[email protected]>

* little fix

Signed-off-by: ArtObr <[email protected]>

* Review changes

Signed-off-by: ArtObr <[email protected]>

* little fix for test passing

Signed-off-by: ArtObr <[email protected]>

* little fix for test passing

Signed-off-by: ArtObr <[email protected]>

* Review change

Signed-off-by: ArtObr <[email protected]>
lampkin-diet pushed a commit to lampkin-diet/indy-plenum that referenced this pull request Apr 10, 2018
…per functions (hyperledger#579)

* Initial test integration

Signed-off-by: ArtObr <[email protected]>

* Two more files done

Signed-off-by: ArtObr <[email protected]>

* new test

Signed-off-by: ArtObr <[email protected]>

* 4 more folders done

Signed-off-by: ArtObr <[email protected]>

* two more files

Signed-off-by: ArtObr <[email protected]>

* some changes

Signed-off-by: ArtObr <[email protected]>

* More tests integrated. Problems: validator functions of client in test_state_proof; problem with wrong bls keys

Signed-off-by: ArtObr <[email protected]>

* Initial commit

Signed-off-by: ArtObr <[email protected]>

* Script fix. bls validation fix

Signed-off-by: ArtObr <[email protected]>

* more changes

Signed-off-by: ArtObr <[email protected]>

* little fix

Signed-off-by: ArtObr <[email protected]>

* Fix for bls validation tests. Not done: update_incorrect test and state_proof test

Signed-off-by: ArtObr <[email protected]>

* Only state_proof test left

Signed-off-by: ArtObr <[email protected]>

* Tests integration done

Signed-off-by: ArtObr <[email protected]>

* Deletion of Client1Connected. More test fix

Signed-off-by: ArtObr <[email protected]>

* Import deletion. flake8 error fix.

Signed-off-by: ArtObr <[email protected]>

* More changes to txnPoolNodeSet

Signed-off-by: ArtObr <[email protected]>

* Changes in tests

Signed-off-by: ArtObr <[email protected]>

* Remove pf TestNodeSet. Change of helper methods. Part 1.

Signed-off-by: ArtObr <[email protected]>

* Remove TestNodeSet from helper. part 2

Signed-off-by: ArtObr <[email protected]>

* More tests integrated

Signed-off-by: ArtObr <[email protected]>

* Functions fixes.

Signed-off-by: ArtObr <[email protected]>

* Fix for genesis txns

Signed-off-by: ArtObr <[email protected]>

* More tests integrated

Signed-off-by: ArtObr <[email protected]>

* primary_selection dependency fix

Signed-off-by: ArtObr <[email protected]>

* Fixture fix for view_change

Signed-off-by: ArtObr <[email protected]>

* View change test fix

Signed-off-by: ArtObr <[email protected]>

* Skips for merkle proof tests

Signed-off-by: ArtObr <[email protected]>

* Skips for merkle proof tests

Signed-off-by: ArtObr <[email protected]>

* Remove sendRandomRequest of old client. Part 1.

Signed-off-by: ArtObr <[email protected]>

* Review changes

Signed-off-by: ArtObr <[email protected]>

* Review changes

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequest. Part 2.

Signed-off-by: ArtObr <[email protected]>

* Little error fix

Signed-off-by: ArtObr <[email protected]>

* waitReqNackFromPoolWithReason function deletion

Signed-off-by: ArtObr <[email protected]>

* waitRejectFromPoolWithReason function deletion

Signed-off-by: ArtObr <[email protected]>

* checkReqNack function deletion

Signed-off-by: ArtObr <[email protected]>

* Two more fucntions deletion

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequests. Part 1.

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequests. Part 2. send_reqs_to_nodes_and_verify_all_replies deleted.

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequests. Part 3.

Signed-off-by: ArtObr <[email protected]>

* Little fix

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequest. Part 4.

Signed-off-by: ArtObr <[email protected]>

* Deletion of sendRandomRequests. Part 5. Deleted: ensure_pool_functional, NodeSetWithNodeAddedAfterSomeTxns, nodeCreatedAfterSomeTxns, newNodeCaughtUp.

Signed-off-by: ArtObr <[email protected]>

* little fix

Signed-off-by: ArtObr <[email protected]>

* little fix

Signed-off-by: ArtObr <[email protected]>

* little fix

Signed-off-by: ArtObr <[email protected]>

* Review changes

Signed-off-by: ArtObr <[email protected]>

* little fix for test passing

Signed-off-by: ArtObr <[email protected]>

* little fix for test passing

Signed-off-by: ArtObr <[email protected]>

* Review change

Signed-off-by: ArtObr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants