Skip to content

Commit

Permalink
GH-1510 Add trx_finality_status_if_test
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jan 31, 2024
1 parent 2d9b5ab commit 6e9fff5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ set_property(TEST nodeos_snapshot_forked_if_test PROPERTY LABELS nonparallelizab

add_test(NAME trx_finality_status_test COMMAND tests/trx_finality_status_test.py -v ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST trx_finality_status_test PROPERTY LABELS nonparallelizable_tests)
add_test(NAME trx_finality_status_if_test COMMAND tests/trx_finality_status_test.py -v --activate-if ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST trx_finality_status_if_test PROPERTY LABELS nonparallelizable_tests)

add_test(NAME trx_finality_status_forked_test COMMAND tests/trx_finality_status_forked_test.py -v ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set_property(TEST trx_finality_status_forked_test PROPERTY LABELS nonparallelizable_tests)
Expand Down
7 changes: 4 additions & 3 deletions tests/trx_finality_status_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
errorExit=Utils.errorExit

appArgs=AppArgs()
args = TestHelper.parse_args({"-n", "--dump-error-details","--keep-logs","-v","--leave-running","--unshared"})
args = TestHelper.parse_args({"-n","--activate-if","--dump-error-details","--keep-logs","-v","--leave-running","--unshared"})
Utils.Debug=args.v
pnodes=3
totalNodes=args.n
if totalNodes<=pnodes+2:
totalNodes=pnodes+2
cluster=Cluster(unshared=args.unshared, keepRunning=args.leave_running, keepLogs=args.keep_logs)
activateIF=args.activate_if
dumpErrorDetails=args.dump_error_details
prodCount=1
walletPort=TestHelper.DEFAULT_WALLET_PORT
Expand All @@ -58,7 +59,7 @@
extraNodeosArgs=" --transaction-finality-status-max-storage-size-gb 1 " + \
f"--transaction-finality-status-success-duration-sec {successDuration} --transaction-finality-status-failure-duration-sec {failure_duration}"
extraNodeosArgs+=" --http-max-response-time-ms 990000"
if cluster.launch(prodCount=prodCount, onlyBios=False, pnodes=pnodes, totalNodes=totalNodes, totalProducers=pnodes*prodCount,
if cluster.launch(prodCount=prodCount, onlyBios=False, pnodes=pnodes, totalNodes=totalNodes, totalProducers=pnodes*prodCount, activateIF=activateIF,
topo="line", extraNodeosArgs=extraNodeosArgs) is False:
Utils.errorExit("Failed to stand up eos cluster.")

Expand Down Expand Up @@ -170,7 +171,7 @@ def validate(status, knownTrx=True):

status.append(testNode.getTransactionStatus(transId))
state = getState(status[1])
assert state == inBlockState, f"ERROR: getTransactionStatus never returned a \"{inBlockState}\" state"
assert state == inBlockState or state == irreversibleState, f"ERROR: getTransactionStatus never returned a \"{inBlockState}\" state or \"{irreversibleState}\""

validateTrxState(status[1], present=True)

Expand Down

0 comments on commit 6e9fff5

Please sign in to comment.