Skip to content

Commit 7121d54

Browse files
authored
Merge pull request #1135 from AntelopeIO/unique-log-files
Test: Create unique log files for nodeos
2 parents c375450 + dac8434 commit 7121d54

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/TestHarness/Node.py

+6
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,12 @@ def launchCmd(self, cmd: List[str], data_dir: Path, launch_time: str):
527527
err = dd / Path(f'stderr.{launch_time}.txt')
528528
pidf = dd / Path(f'{Utils.EosServerName}.pid')
529529

530+
# make sure unique file name to avoid overwrite of existing log file
531+
i = 0
532+
while err.is_file():
533+
i = i + 1
534+
err = dd / Path(f'stderr.{launch_time}-{i}.txt')
535+
530536
Utils.Print(f'spawning child: {" ".join(cmd)}')
531537
dd.mkdir(parents=True, exist_ok=True)
532538
with out.open('w') as sout, err.open('w') as serr:

0 commit comments

Comments
 (0)