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

Loosen production round requirement #9211

Merged
merged 2 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tests/nodeos_forked_chain_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def getBlock(self, blockNum):
producerToSlot={}
slot=-1
inRowCountPerProducer=12
minNumBlocksPerProducer=10
lastTimestamp=timestamp
headBlockNum=node.getBlockNum()
firstBlockForWindowMissedSlot=None
Expand All @@ -319,6 +320,7 @@ def getBlock(self, blockNum):
if firstBlockForWindowMissedSlot is not None:
missedSlotAfter.append(firstBlockForWindowMissedSlot)
firstBlockForWindowMissedSlot=None

while blockProducer==lastBlockProducer:
producerToSlot[blockProducer]["count"]+=1
blockNum+=1
Expand All @@ -339,13 +341,16 @@ def getBlock(self, blockNum):
missedSlotAfter.append("%d (%s)" % (blockNum-1, missed))
lastTimestamp=timestamp

if producerToSlot[lastBlockProducer]["count"]!=inRowCountPerProducer:
if producerToSlot[lastBlockProducer]["count"] < minNumBlocksPerProducer or producerToSlot[lastBlockProducer]["count"] > inRowCountPerProducer:
Utils.errorExit("Producer %s, in slot %d, expected to produce %d blocks but produced %d blocks. At block number %d. " %
(lastBlockProducer, slot, inRowCountPerProducer, producerToSlot[lastBlockProducer]["count"], blockNum-1) +
"Slots were missed after the following blocks: %s" % (", ".join(missedSlotAfter)))
elif len(missedSlotAfter) > 0:
# if there was a full round, then the most recent producer missed a slot
firstBlockForWindowMissedSlot=missedSlotAfter[0]

if len(missedSlotAfter) > 0:
# it may be the most recent producer missed a slot
possibleMissed=missedSlotAfter[-1]
if possibleMissed == blockNum - 1:
firstBlockForWindowMissedSlot=possibleMissed

if blockProducer==productionCycle[0]:
break
Expand Down
2 changes: 1 addition & 1 deletion tests/nodeos_high_transaction_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

appArgs = AppArgs()
minTotalAccounts = 20
extraArgs = appArgs.add(flag="--transaction-time-delta", type=int, help="How many seconds seconds behind an earlier sent transaction should be received after a later one", default=5)
extraArgs = appArgs.add(flag="--transaction-time-delta", type=int, help="How many seconds seconds behind an earlier sent transaction should be received after a later one", default=7)
extraArgs = appArgs.add(flag="--num-transactions", type=int, help="How many total transactions should be sent", default=10000)
extraArgs = appArgs.add(flag="--max-transactions-per-second", type=int, help="How many transactions per second should be sent", default=500)
extraArgs = appArgs.add(flag="--total-accounts", type=int, help="How many accounts should be involved in sending transfers. Must be greater than %d" % (minTotalAccounts), default=100)
Expand Down