Skip to content

Commit

Permalink
Address peer review comments.
Browse files Browse the repository at this point in the history
Rename and simplify test naming for clarity.
Rename endpoint api type to simply be endpoint mode for clarity.
  • Loading branch information
oschwaldp-oci committed Jun 6, 2023
1 parent 85ea6ff commit a8f559c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion tests/TestHarness/Cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ def launchTrxGenerators(self, contractOwnerAcctName: str, acctNamesList: list, a
contractOwnerAccount=contractOwnerAcctName, accts=','.join(map(str, acctNamesList)),
privateKeys=','.join(map(str, acctPrivKeysList)), trxGenDurationSec=durationSec, logDir=Utils.DataDir,
abiFile=abiFile, actionsData=actionsData, actionsAuths=actionsAuths, tpsTrxGensConfig=tpsTrxGensConfig,
endpointApiType="p2p")
endpointMode="p2p")

Utils.Print("Launch txn generators and start generating/sending transactions")
self.trxGenLauncher.launch(waitToComplete=waitToComplete)
Expand Down
10 changes: 5 additions & 5 deletions tests/TestHarness/launch_transaction_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, targetTps: int, tpsLimitPerGenerator: int, connectionPairList
class TransactionGeneratorsLauncher:

def __init__(self, chainId: int, lastIrreversibleBlockId: int, contractOwnerAccount: str, accts: str, privateKeys: str, trxGenDurationSec: int, logDir: str,
abiFile: Path, actionsData, actionsAuths, tpsTrxGensConfig: TpsTrxGensConfig, endpointApiType: str, apiEndpoint: str=None):
abiFile: Path, actionsData, actionsAuths, tpsTrxGensConfig: TpsTrxGensConfig, endpointMode: str, apiEndpoint: str=None):
self.chainId = chainId
self.lastIrreversibleBlockId = lastIrreversibleBlockId
self.contractOwnerAccount = contractOwnerAccount
Expand All @@ -50,7 +50,7 @@ def __init__(self, chainId: int, lastIrreversibleBlockId: int, contractOwnerAcco
self.abiFile = abiFile
self.actionsData = actionsData
self.actionsAuths = actionsAuths
self.endpointApiType = endpointApiType
self.endpointMode = endpointMode
self.apiEndpoint = apiEndpoint

def launch(self, waitToComplete=True):
Expand All @@ -69,7 +69,7 @@ def launch(self, waitToComplete=True):
'--trx-gen-duration', f'{self.trxGenDurationSec}',
'--target-tps', f'{targetTps}',
'--log-dir', f'{self.logDir}',
'--peer-endpoint-type', f'{self.endpointApiType}',
'--peer-endpoint-type', f'{self.endpointMode}',
'--peer-endpoint', f'{connectionPair[0]}',
'--port', f'{connectionPair[1]}']
if self.abiFile is not None and self.actionsData is not None and self.actionsAuths is not None:
Expand Down Expand Up @@ -110,7 +110,7 @@ def parseArgs():
parser.add_argument("actions_data", type=str, help="The json actions data file or json actions data description string to use")
parser.add_argument("actions_auths", type=str, help="The json actions auth file or json actions auths description string to use, containting authAcctName to activePrivateKey pairs.")
parser.add_argument("connection_pair_list", type=str, help="Comma separated list of endpoint:port combinations to send transactions to", default="localhost:9876")
parser.add_argument("endpoint_api_type", type=str, help="Endpoint API mode (\"p2p\", \"http\"). \
parser.add_argument("endpoint_mode", type=str, help="Endpoint mode (\"p2p\", \"http\"). \
In \"p2p\" mode transactions will be directed to the p2p endpoint on a producer node. \
In \"http\" mode transactions will be directed to the http endpoint on an api node.",
choices=["p2p", "http"], default="p2p")
Expand All @@ -131,7 +131,7 @@ def main():
abiFile=args.abi_file, actionsData=args.actions_data, actionsAuths=args.actions_auths,
tpsTrxGensConfig=TpsTrxGensConfig(targetTps=args.target_tps, tpsLimitPerGenerator=args.tps_limit_per_generator,
connectionPairList=connectionPairList),
endpointApiType=args.endpoint_api_type, apiEndpoint=args.api_endpoint)
endpointMode=args.endpoint_mode, apiEndpoint=args.api_endpoint)


exit_codes = trxGenLauncher.launch()
Expand Down
30 changes: 15 additions & 15 deletions tests/performance_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ endif()

add_test(NAME performance_test_bp COMMAND tests/performance_tests/performance_test.py testBpOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 --calc-chain-threads lmax overrideBasicTestConfig -v --tps-limit-per-generator 25 --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_api COMMAND tests/performance_tests/performance_test.py testApiOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 --calc-chain-threads lmax overrideBasicTestConfig -v --tps-limit-per-generator 25 --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_ro COMMAND tests/performance_tests/performance_test.py testApiOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 overrideBasicTestConfig -v --tps-limit-per-generator 25 --api-nodes-read-only-threads 2 --account-name "payloadless" --abi-file payloadless.abi --wasm-file payloadless.wasm --contract-dir unittests/test-contracts/payloadless --user-trx-data-file tests/performance_tests/readOnlyTrxData.json --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_ex_cpu_trx_spec COMMAND tests/performance_tests/performance_test.py testBpOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 overrideBasicTestConfig -v --tps-limit-per-generator 25 --chain-state-db-size-mb 200 --account-name "c" --abi-file eosmechanics.abi --wasm-file eosmechanics.wasm --contract-dir unittests/contracts/eosio.mechanics --user-trx-data-file tests/performance_tests/cpuTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_read_only_trxs COMMAND tests/performance_tests/performance_test.py testApiOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 overrideBasicTestConfig -v --tps-limit-per-generator 25 --api-nodes-read-only-threads 2 --account-name "payloadless" --abi-file payloadless.abi --wasm-file payloadless.wasm --contract-dir unittests/test-contracts/payloadless --user-trx-data-file tests/performance_tests/readOnlyTrxData.json --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_cpu_trx_spec COMMAND tests/performance_tests/performance_test.py testBpOpMode --max-tps-to-test 50 --test-iteration-min-step 10 --test-iteration-duration-sec 10 --final-iterations-duration-sec 10 overrideBasicTestConfig -v --tps-limit-per-generator 25 --chain-state-db-size-mb 200 --account-name "c" --abi-file eosmechanics.abi --wasm-file eosmechanics.wasm --contract-dir unittests/contracts/eosio.mechanics --user-trx-data-file tests/performance_tests/cpuTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_p2p COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_http COMMAND tests/performance_tests/performance_test_basic.py -v --endpoint-api-type http --producer-nodes 1 --validation-nodes 1 --api-nodes 1 --target-tps 10 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_transfer_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --user-trx-data-file tests/performance_tests/userTrxDataTransfer.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_new_acct_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --user-trx-data-file tests/performance_tests/userTrxDataNewAccount.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_cpu_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "c" --abi-file eosmechanics.abi --wasm-file eosmechanics.wasm --contract-dir unittests/contracts/eosio.mechanics --user-trx-data-file tests/performance_tests/cpuTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_ram_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "r" --abi-file eosmechanics.abi --wasm-file eosmechanics.wasm --contract-dir unittests/contracts/eosio.mechanics --user-trx-data-file tests/performance_tests/ramTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ex_read_only_trxs COMMAND tests/performance_tests/performance_test_basic.py -v --endpoint-api-type http --producer-nodes 1 --validation-nodes 1 --api-nodes 1 --api-nodes-read-only-threads 2 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "payloadless" --abi-file payloadless.abi --wasm-file payloadless.wasm --contract-dir unittests/test-contracts/payloadless --user-trx-data-file tests/performance_tests/readOnlyTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_http COMMAND tests/performance_tests/performance_test_basic.py -v --endpoint-mode http --producer-nodes 1 --validation-nodes 1 --api-nodes 1 --target-tps 10 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_transfer_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --user-trx-data-file tests/performance_tests/userTrxDataTransfer.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_new_acct_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --user-trx-data-file tests/performance_tests/userTrxDataNewAccount.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_cpu_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "c" --abi-file eosmechanics.abi --wasm-file eosmechanics.wasm --contract-dir unittests/contracts/eosio.mechanics --user-trx-data-file tests/performance_tests/cpuTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_ram_trx_spec COMMAND tests/performance_tests/performance_test_basic.py -v --producer-nodes 1 --validation-nodes 1 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "r" --abi-file eosmechanics.abi --wasm-file eosmechanics.wasm --contract-dir unittests/contracts/eosio.mechanics --user-trx-data-file tests/performance_tests/ramTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME performance_test_basic_read_only_trxs COMMAND tests/performance_tests/performance_test_basic.py -v --endpoint-mode http --producer-nodes 1 --validation-nodes 1 --api-nodes 1 --api-nodes-read-only-threads 2 --target-tps 20 --tps-limit-per-generator 10 --test-duration-sec 5 --chain-state-db-size-mb 200 --account-name "payloadless" --abi-file payloadless.abi --wasm-file payloadless.wasm --contract-dir unittests/test-contracts/payloadless --user-trx-data-file tests/performance_tests/readOnlyTrxData.json ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST performance_test_bp PROPERTY LABELS long_running_tests)
set_property(TEST performance_test_api PROPERTY LABELS long_running_tests)
set_property(TEST performance_test_ro PROPERTY LABELS long_running_tests)
set_property(TEST performance_test_ex_cpu_trx_spec PROPERTY LABELS long_running_tests)
set_property(TEST performance_test_read_only_trxs PROPERTY LABELS long_running_tests)
set_property(TEST performance_test_cpu_trx_spec PROPERTY LABELS long_running_tests)
set_property(TEST performance_test_basic_p2p PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_http PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_ex_transfer_trx_spec PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_ex_new_acct_trx_spec PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_ex_cpu_trx_spec PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_ex_ram_trx_spec PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_ex_read_only_trxs PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_transfer_trx_spec PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_new_acct_trx_spec PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_cpu_trx_spec PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_ram_trx_spec PROPERTY LABELS nonparallelizable_tests)
set_property(TEST performance_test_basic_read_only_trxs PROPERTY LABELS nonparallelizable_tests)

add_subdirectory( NodeosPluginArgs )
16 changes: 8 additions & 8 deletions tests/performance_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ Advanced Configuration Options:
```
usage: performance_test.py testBpOpMode overrideBasicTestConfig
[-h] [-d D] [--dump-error-details] [-v] [--leave-running] [--unshared]
[--endpoint-api-type {p2p,http}]
[--endpoint-mode {p2p,http}]
[--producer-nodes PRODUCER_NODES] [--validation-nodes VALIDATION_NODES] [--api-nodes API_NODES]
[--api-nodes-read-only-threads API_NODES_READ_ONLY_THREADS]
[--tps-limit-per-generator TPS_LIMIT_PER_GENERATOR]
Expand Down Expand Up @@ -509,8 +509,8 @@ Test Helper Arguments:
Performance Test Basic Base:
Performance Test Basic base configuration items.
--endpoint-api-type {p2p,http}
Endpointt API mode ("p2p", "http"). In "p2p" mode transactions will be directed to the p2p endpoint on a producer node. In "http" mode transactions will be directed to the http endpoint on an api node.
--endpoint-mode {p2p,http}
Endpoint Mode ("p2p", "http"). In "p2p" mode transactions will be directed to the p2p endpoint on a producer node. In "http" mode transactions will be directed to the http endpoint on an api node.
--producer-nodes PRODUCER_NODES
Producing nodes count
--validation-nodes VALIDATION_NODES
Expand Down Expand Up @@ -607,7 +607,7 @@ The following scripts are typically used by the Performance Harness main script
usage: performance_test_basic.py [-h] [-d D]
[--dump-error-details] [-v] [--leave-running]
[--unshared]
[--endpoint-api-type {p2p,http}]
[--endpoint-mode {p2p,http}]
[--producer-nodes PRODUCER_NODES]
[--validation-nodes VALIDATION_NODES]
[--api-nodes API_NODES]
Expand Down Expand Up @@ -666,8 +666,8 @@ Test Helper Arguments:
Performance Test Basic Base:
Performance Test Basic base configuration items.
--endpoint-api-type {p2p,http}
Endpointt API mode ("p2p", "http"). In "p2p" mode transactions will be directed to the p2p endpoint on a producer node. In "http" mode transactions will be directed to the http endpoint on an api node.
--endpoint-mode {p2p,http}
Endpoint Mode ("p2p", "http"). In "p2p" mode transactions will be directed to the p2p endpoint on a producer node. In "http" mode transactions will be directed to the http endpoint on an api node.
(default: p2p)
--producer-nodes PRODUCER_NODES
Producing nodes count (default: 1)
Expand Down Expand Up @@ -1738,7 +1738,7 @@ Finally, the full detail test report for each of the determined max TPS throughp
"calcChainThreads": "lmax",
"calcNetThreads": "lmax",
"userTrxDataFile": null,
"endpointApiType": "p2p",
"endpointMode": "p2p",
"opModeCmd": "testBpOpMode",
"logDirBase": "performance_test",
"logDirTimestamp": "2023-06-05_17-59-49",
Expand Down Expand Up @@ -2401,7 +2401,7 @@ The Performance Test Basic generates, by default, a report that details results
"expectedTransactionsSent": 130010,
"printMissingTransactions": false,
"userTrxDataFile": null,
"endpointApiType": "p2p",
"endpointMode": "p2p",
"apiEndpoint": null,
"logDirBase": "performance_test/2023-06-05_17-59-49/testRunLogs/performance_test",
"logDirTimestamp": "2023-06-05_19-21-44",
Expand Down
Loading

0 comments on commit a8f559c

Please sign in to comment.