提交 983d6019 编写于 作者: B Brian Johnson

Added printing out block logs if a transaction was missed. GH #5674

上级 173139c8
......@@ -32,6 +32,7 @@ class Cluster(object):
__bootlog="eosio-ignition-wd/bootlog.txt"
__configDir="etc/eosio/"
__dataDir="var/lib/"
__fileDivider="================================================================="
# pylint: disable=too-many-arguments
# walletd [True|False] Is keosd running. If not load the wallet plugin
......@@ -1265,7 +1266,7 @@ class Cluster(object):
@staticmethod
def dumpErrorDetailImpl(fileName):
Utils.Print("=================================================================")
Utils.Print(Cluster.__fileDivider)
Utils.Print("Contents of %s:" % (fileName))
if os.path.exists(fileName):
with open(fileName, "r") as f:
......@@ -1414,3 +1415,38 @@ class Cluster(object):
node.reportStatus()
except:
Utils.Print("No reportStatus")
def printBlockLogIfNeeded(self):
printBlockLog=False
if hasattr(self, "nodes"):
for node in self.nodes:
if node.missingTransaction:
printBlockLog=True
break
if hasattr(self, "biosNode") and self.biosNode.missingTransaction:
printBlockLog=True
if not printBlockLog:
return
self.printBlockLog()
def printBlockLog(self):
blockLogDir=Cluster.__dataDir + Cluster.nodeExtensionToName("bios") + "/blocks/"
blockLogBios=Utils.getBlockLog(blockLogDir, exitOnError=False)
Utils.Print(Cluster.__fileDivider)
Utils.Print("Block log from %s:\n%s" % (blockLogDir, json.dumps(blockLogBios, indent=1)))
if not hasattr(self, "nodes"):
return
numNodes=len(self.nodes)
for i in range(numNodes):
node=self.nodes[i]
blockLogDir=Cluster.__dataDir + Cluster.nodeExtensionToName(i) + "/blocks/"
blockLog=Utils.getBlockLog(blockLogDir, exitOnError=False)
Utils.Print(Cluster.__fileDivider)
Utils.Print("Block log from %s:\n%s" % (blockLogDir, json.dumps(blockLog, indent=1)))
......@@ -148,6 +148,7 @@ class TestHelper(object):
cluster.dumpErrorDetails()
if walletMgr:
walletMgr.dumpErrorDetails()
cluster.printBlockLogIfNeeded()
Utils.Print("== Errors see above ==")
if len(Utils.CheckOutputDeque)>0:
Utils.Print("== cout/cerr pairs from last %d calls to Utils. ==" % len(Utils.CheckOutputDeque))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册