Skip to content

Commit

Permalink
GH-13 Add rmArgs option to relaunch. Add removeFinalizersSafetyFile m…
Browse files Browse the repository at this point in the history
…ethod.
  • Loading branch information
heifner committed May 17, 2024
1 parent 94231e5 commit 29c7626
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/TestHarness/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ def rmFromCmd(self, matchValue: str):

# pylint: disable=too-many-locals
# If nodeosPath is equal to None, it will use the existing nodeos path
def relaunch(self, chainArg=None, newChain=False, skipGenesis=True, timeout=Utils.systemWaitTimeout, addSwapFlags=None, nodeosPath=None, waitForTerm=False):
def relaunch(self, chainArg=None, newChain=False, skipGenesis=True, timeout=Utils.systemWaitTimeout,
addSwapFlags=None, rmArgs=None, nodeosPath=None, waitForTerm=False):

assert(self.pid is None)
assert(self.killed)
Expand All @@ -370,6 +371,10 @@ def relaunch(self, chainArg=None, newChain=False, skipGenesis=True, timeout=Util
cmdArr=self.cmd[:]
if nodeosPath: cmdArr[0] = nodeosPath
toAddOrSwap=copy.deepcopy(addSwapFlags) if addSwapFlags is not None else {}
if rmArgs is not None:
for v in shlex.split(rmArgs):
i = cmdArr.index(v)
cmdArr.pop(i)
if not newChain:
if skipGenesis:
try:
Expand Down Expand Up @@ -558,6 +563,11 @@ def removeReversibleBlks(self):
reversibleBlks = os.path.join(dataDir, "blocks", "reversible")
shutil.rmtree(reversibleBlks, ignore_errors=True)

def removeFinalizersSafetyFile(self):
dataDir = Utils.getNodeDataDir(self.nodeId)
finalizersDir = os.path.join(dataDir, "finalizers")
shutil.rmtree(finalizersDir, ignore_errors=True)

@staticmethod
def findStderrFiles(path):
files=[]
Expand Down

0 comments on commit 29c7626

Please sign in to comment.