Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10258 from EOSIO/bdj__missed-comments-for-gh-10253
Browse files Browse the repository at this point in the history
Missed Peer Review comment changes from #10253.
  • Loading branch information
brianjohnson5972 authored Apr 19, 2021
2 parents ca8a056 + 353314e commit 472a394
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ add_test(NAME eosio_blocklog_prune_test COMMAND tests/eosio_blocklog_prune_test.
set_property(TEST eosio_blocklog_prune_test PROPERTY LABELS nonparallelizable_tests)
add_test(NAME privacy_startup_network COMMAND tests/privacy_startup_network.py -p 1 -v --clean-run --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST privacy_startup_network PROPERTY LABELS nonparallelizable_tests)
add_test(NAME privacy_simple_network COMMAND tests/privacy_simple_network.py -p 2 -n 4 -v --clean-run --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME privacy_simple_network COMMAND tests/privacy_simple_network.py -p 2 -n 3 -v --clean-run --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST privacy_simple_network PROPERTY LABELS nonparallelizable_tests)

# Long running tests
Expand Down
4 changes: 1 addition & 3 deletions tests/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1863,11 +1863,9 @@ def verifyInSync(self, sourceNodeNum=0, specificNodes=None):
Utils.errorExit(error)

def getParticipantNum(self, nodeToIdentify):
num = 0
for node in self.nodes:
for num, node in zip(range(len(self.nodes)), self.nodes):
if node == nodeToIdentify:
return num
num += 1
assert nodeToIdentify == self.biosNode
return self.totalNodes

Expand Down
8 changes: 2 additions & 6 deletions tests/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,6 @@ def activateAndVerifyFeatures(self, features):
headBlockNum = self.getBlockNum()
blockNum = headBlockNum
producers = {}
lastProducer = None
while True:
block = self.getBlock(blockNum)
blockHeaderState = self.getBlockHeaderState(blockNum)
Expand All @@ -1482,15 +1481,12 @@ def activateAndVerifyFeatures(self, features):

producer = block["producer"]
producers[producer] += 1
assert lastProducer != producer or producers[producer] == 1, \
"We have already cycled through a complete cycle, so feature should have been set by now. \
Initial block num: {}, looking at block num: {}".format(headBlockNum, blockNum)

# feature should be in block for this node's producers, if it is at least 2 blocks after we sent the activate
minBlocksForGuarantee = 2
assert producer not in self.getProducers() or blockNum - headBlockNum < minBlocksForGuarantee, \
"It is {} blocks past the block when we activated the features and block num: {} was produced by this \
node, so features should have been set."
"It is {} blocks past the block when we activated the features and block num {} was produced by this \
node, so features should have been set.".format(blockNum - headBlockNum, blockNum)
self.waitForBlock(blockNum + 1)
blockNum = self.getBlockNum()

Expand Down
14 changes: 3 additions & 11 deletions tests/privacy_simple_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,8 @@ def publishContract(account, file, waitForTransBlock=False):
publishProcessNum = 20
def security_group(addNodeNums=[], removeNodeNums=[]):
def createAction(nodeNums):
action = None
for nodeNum in nodeNums:
if action is None:
action = '[['
else:
action += ','
action += '"{}"'.format(Node.participantName(nodeNum))
if action:
action += ']]'
return action
return None if len(nodeNums) == 0 else \
"[[{}]]".format(','.join(['"{}"'.format(Node.participantName(nodeNum)) for nodeNum in nodeNums]))

addAction = createAction(addNodeNums)
removeAction = createAction(removeNodeNums)
Expand Down Expand Up @@ -246,7 +238,7 @@ def is_done():

while not done and len(participants) > pnodes:
publishTrans = remFromSg()
Utils.Print("publishTrans: {}".format(json.dumps(publishTrans, indent=2)))
Utils.Print("publishTrans: {}".format(json.dumps(publishTrans, indent=4)))
blockNum = Node.getTransBlockNum(publishTrans[1])
if initialBlockNum is None:
initialBlockNum = blockNum
Expand Down

0 comments on commit 472a394

Please sign in to comment.