Skip to content

Commit

Permalink
Merge pull request #731 from AntelopeIO/performance_harness_shutdown_…
Browse files Browse the repository at this point in the history
…trxgenlauncher

[PH] Add TransactionGeneratorLauncher to TestHelper Shutdown
  • Loading branch information
ClaytonCalabrese authored Feb 22, 2023
2 parents 6e5cb4a + c15ed53 commit 5980ed3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/performance_tests/performance_test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ def runTpsTest(self) -> PtbTpsTestResult:
self.data.startBlock = self.waitForEmptyBlocks(self.validationNode, self.emptyBlockGoal)
tpsTrxGensConfig = TpsTrxGensConfig(targetTps=self.ptbConfig.targetTps, tpsLimitPerGenerator=self.ptbConfig.tpsLimitPerGenerator)

trxGenLauncher = TransactionGeneratorsLauncher(chainId=chainId, lastIrreversibleBlockId=lib_id, contractOwnerAccount=self.clusterConfig.specifiedContract.accountName,
self.cluster.trxGenLauncher = TransactionGeneratorsLauncher(chainId=chainId, lastIrreversibleBlockId=lib_id, contractOwnerAccount=self.clusterConfig.specifiedContract.accountName,
accts=','.join(map(str, self.accountNames)), privateKeys=','.join(map(str, self.accountPrivKeys)),
trxGenDurationSec=self.ptbConfig.testTrxGenDurationSec, logDir=self.trxGenLogDirPath,
abiFile=abiFile, actionsData=actionsDataJson, actionsAuths=actionsAuthsJson,
peerEndpoint=self.producerNode.host, port=self.producerP2pPort, tpsTrxGensConfig=tpsTrxGensConfig)

trxGenExitCodes = trxGenLauncher.launch()
trxGenExitCodes = self.cluster.trxGenLauncher.launch()
print(f"Transaction Generator exit codes: {trxGenExitCodes}")
for exitCode in trxGenExitCodes:
if exitCode != 0:
Expand Down Expand Up @@ -461,7 +461,6 @@ def postTpsTestSteps(self):

def runTest(self) -> bool:
testSuccessful = False
completedRun = False

try:
# Kill any existing instances and launch cluster
Expand Down Expand Up @@ -500,10 +499,6 @@ def runTest(self) -> bool:
if not self.ptbConfig.delPerfLogs:
self.captureLowLevelArtifacts()

if not completedRun:
os.system("pkill trx_generator")
print("Test run cancelled early via SIGINT")

if self.ptbConfig.delPerfLogs:
print(f"Cleaning up logs directory: {self.loggingConfig.logDirPath}")
self.testDirsCleanup(self.ptbConfig.delReport)
Expand Down

0 comments on commit 5980ed3

Please sign in to comment.