Skip to content

Commit

Permalink
Merge pull request #2014 from AntelopeIO/GH-2006-test-no-block-log-sy…
Browse files Browse the repository at this point in the history
…nc-main

[5.0 -> main] Test: Check for unlinkable blocks while syncing
  • Loading branch information
heifner authored Dec 21, 2023
2 parents 952aedf + c8920c3 commit 1f118d3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/nodeos_startup_catchup.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ def waitForNodeStarted(node):
waitForBlock(node0, catchupHead+5, timeout=twoRoundsTimeout*2, blockType=BlockType.lib)

Print("Restart catchup node")
catchupNode.relaunch()
addSwapFlags = None
if catchup_num % 3 == 0:
addSwapFlags = {"--block-log-retain-blocks": "0", "--delete-all": ""}
catchupNode.relaunch(skipGenesis=False, addSwapFlags=addSwapFlags)
waitForNodeStarted(catchupNode)
lastCatchupLibNum=lib(catchupNode)

Expand All @@ -189,6 +192,12 @@ def waitForNodeStarted(node):
catchupNode.interruptAndVerifyExitStatus(60)
catchupNode.popenProc=None

logFile = Utils.getNodeDataDir(catchupNodeNum) + "/stderr.txt"
f = open(logFile)
contents = f.read()
if contents.count("3030001 unlinkable_block_exception: Unlinkable block") > 10: # a few are fine
errorExit(f"Node{catchupNodeNum} has unlinkable blocks: {logFile}.")

testSuccessful=True

finally:
Expand Down

0 comments on commit 1f118d3

Please sign in to comment.