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

[1.0.3] Test failure: distributed-transactions-if-test #908

Merged
merged 4 commits into from
Oct 8, 2024
Merged
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
44 changes: 23 additions & 21 deletions tests/TestHarness/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,37 +708,39 @@ def countInLog(self, searchStr) -> int:
count += contents.count(searchStr)
return count

# verify only one or two 'Starting block' per block number unless block is restarted
# Verify that we have only one "Starting block" in the log for any block number unless:
# - the block was restarted because it was exhausted,
# - or the second "Starting block" is for a different block time than the first.
# -------------------------------------------------------------------------------------
def verifyStartingBlockMessages(self):
dataDir=Utils.getNodeDataDir(self.nodeId)
files=Node.findStderrFiles(dataDir)
restarting_exhausted_regexp = re.compile(r"Restarting exhausted speculative block #(\d+)")
starting_block_regexp = re.compile(r"Starting block #(\d+) .*(\d\d:\d\d\.\d\d\d) producer")

for f in files:
blockNumbers = set()
duplicateBlockNumbers = set()
threeStartsFound = False
lastRestartBlockNum = 0
blockNumber = 0
notRestartedBlockNumbersAndTimes = {}
duplicateStartFound = False

with open(f, 'r') as file:
for line in file:
match = re.match(r".*Restarting exhausted speculative block #(\d+)", line)
match = restarting_exhausted_regexp.match(line)
if match:
lastRestartBlockNum = match.group(1)
continue
if re.match(r".*unlinkable_block_exception", line):
lastRestartBlockNum = blockNumber
# remove restarted block
notRestartedBlockNumbersAndTimes.pop(match.group(1), None)
continue
match = re.match(r".*Starting block #(\d+)", line)
match = starting_block_regexp.match(line)
if match:
blockNumber = match.group(1)
if blockNumber != lastRestartBlockNum and blockNumber in duplicateBlockNumbers:
print(f"Duplicate Staring block found: {blockNumber} in {f}")
threeStartsFound = True
if blockNumber != lastRestartBlockNum and blockNumber in blockNumbers:
duplicateBlockNumbers.add(blockNumber)
blockNumbers.add(blockNumber)

return not threeStartsFound
blockNumber, time = match.group(1), match.group(2)
if blockNumber in notRestartedBlockNumbersAndTimes and notRestartedBlockNumbersAndTimes[blockNumber] == time:
print(f"Duplicate Starting block found: {blockNumber} in {f}")
duplicateStartFound = True
break
notRestartedBlockNumbersAndTimes[blockNumber] = time
if duplicateStartFound:
break

return not duplicateStartFound

def analyzeProduction(self, specificBlockNum=None, thresholdMs=500):
dataDir=Utils.getNodeDataDir(self.nodeId)
Expand Down