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

[5.0] Test: Check for unlinkable blocks while syncing #2008

Merged
merged 2 commits into from
Dec 20, 2023
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
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("unlinkable_block_exception") > 3: # a few are fine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can even make it to 10 to prevent test flakeness.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets see how it goes. If we see flakiness then we can adjust up.

errorExit(f"Node{catchupNodeNum} has unlinkable blocks: {logFile}.")

testSuccessful=True

finally:
Expand Down