Skip to content

Commit

Permalink
GH-1837 Allow a couple of start blocks per block as forks cause multiple
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Oct 31, 2023
1 parent 1dac3fb commit 79dccc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions tests/TestHarness/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,13 @@ def findInLog(self, searchStr):
return True
return False

# verify only one 'Starting block' per block number unless block is restarted
def verifyOnlyOneStartingBlock(self):
# verify only one or two 'Starting block' per block number unless block is restarted
def verifyStartingBlockMessages(self):
dataDir=Utils.getNodeDataDir(self.nodeId)
files=Node.findStderrFiles(dataDir)
for f in files:
blockNumbers = set()
duplicateBlockNumbers = set()
duplicatesFound = False
lastRestartBlockNum = 0

Expand All @@ -569,9 +570,11 @@ def verifyOnlyOneStartingBlock(self):
match = re.match(r".*Starting block #(\d+)", line)
if match:
blockNumber = match.group(1)
if blockNumber != lastRestartBlockNum and blockNumber in blockNumbers:
if blockNumber != lastRestartBlockNum and blockNumber in duplicateBlockNumbers:
print(f"Duplicate Staring block found: {blockNumber} in {f}")
duplicatesFound = True
if blockNumber != lastRestartBlockNum and blockNumber in blockNumbers:
duplicateBlockNumbers.add(blockNumber)
blockNumbers.add(blockNumber)

if duplicatesFound:
Expand Down
2 changes: 1 addition & 1 deletion tests/distributed-transactions-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@

# verify only one start block per block unless interrupted
for node in cluster.getAllNodes():
if not node.verifyOnlyOneStartingBlock():
if not node.verifyStartingBlockMessages():
errorExit("Found more than one Starting block in logs")

testSuccessful=True
Expand Down

0 comments on commit 79dccc5

Please sign in to comment.