From 9224548642c8d68802495f98065db396007a2e7b Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Wed, 27 Aug 2025 15:06:37 -0400 Subject: [PATCH 1/5] putative fix for pingpong after #6286 --- shared/pingpong/pingpong.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/pingpong/pingpong.go b/shared/pingpong/pingpong.go index 99942fd7eb..b3c187daaf 100644 --- a/shared/pingpong/pingpong.go +++ b/shared/pingpong/pingpong.go @@ -1205,6 +1205,7 @@ func (pps *WorkerState) constructAppTxn(from string, fee uint64, client *libgoal } appOptIns := pps.cinfo.OptIns[aidx] + sender = from if len(appOptIns) > 0 { indices := rand.Perm(len(appOptIns)) limit := 5 @@ -1219,6 +1220,7 @@ func (pps *WorkerState) constructAppTxn(from string, fee uint64, client *libgoal if pps.cinfo.AppParams[aidx].Creator != from && !slices.Contains(appOptIns, from) { from = accounts[0] + sender = from } accounts = accounts[1:] } From b73e432f637688e039a4a1d453326a839f692a9c Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Wed, 27 Aug 2025 21:16:35 -0400 Subject: [PATCH 2/5] make a bunch of pingpong expect tests --- .../cli/goal/expect/goalExpectCommon.exp | 26 ++++- .../goal/expect/pingpongAssetLargeTest.exp | 5 + .../goal/expect/pingpongAssetSmallTest.exp | 5 + .../goal/expect/pingpongAtomicLargeTest.exp | 5 + .../goal/expect/pingpongAtomicSmallTest.exp | 5 + .../goal/expect/pingpongBigOpsBigHashTest.exp | 5 + .../expect/pingpongBigOpsMediumHashTest.exp | 5 + .../expect/pingpongBigOpsSmallHashTest.exp | 5 + .../e2e-go/cli/goal/expect/pingpongCommon.exp | 98 ++++++++++++++++ .../expect/pingpongMediumOpsBigHashTest.exp | 5 + .../pingpongMediumOpsMediumHashTest.exp | 5 + .../expect/pingpongMediumOpsSmallHashTest.exp | 5 + .../cli/goal/expect/pingpongPaymentTest.exp | 5 + .../cli/goal/expect/pingpongRekeyTest.exp | 5 + .../expect/pingpongSmallOpsBigHashTest.exp | 5 + .../expect/pingpongSmallOpsMediumHashTest.exp | 5 + .../expect/pingpongSmallOpsSmallHashTest.exp | 5 + .../expect/pingpongStatefulBoxReadTest.exp | 5 + .../expect/pingpongStatefulBoxUpdateTest.exp | 5 + .../goal/expect/pingpongStatefulLargeTest.exp | 5 + .../expect/pingpongStatefulMediumTest.exp | 5 + .../goal/expect/pingpongStatefulSmallTest.exp | 5 + .../cli/goal/expect/pingpongTealHeavyTest.exp | 5 + .../cli/goal/expect/pingpongTealLightTest.exp | 5 + .../goal/expect/pingpongTealNormalTest.exp | 5 + test/e2e-go/cli/goal/expect/pingpongTest.exp | 106 ------------------ test/framework/fixtures/expectFixture.go | 3 +- 27 files changed, 238 insertions(+), 110 deletions(-) create mode 100644 test/e2e-go/cli/goal/expect/pingpongAssetLargeTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongAssetSmallTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongAtomicLargeTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongAtomicSmallTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongBigOpsBigHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongBigOpsMediumHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongBigOpsSmallHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongCommon.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongMediumOpsBigHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongMediumOpsMediumHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongMediumOpsSmallHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongPaymentTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongRekeyTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongSmallOpsBigHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongSmallOpsMediumHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongSmallOpsSmallHashTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongStatefulBoxReadTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongStatefulBoxUpdateTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongStatefulLargeTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongStatefulMediumTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongStatefulSmallTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongTealHeavyTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongTealLightTest.exp create mode 100644 test/e2e-go/cli/goal/expect/pingpongTealNormalTest.exp delete mode 100644 test/e2e-go/cli/goal/expect/pingpongTest.exp diff --git a/test/e2e-go/cli/goal/expect/goalExpectCommon.exp b/test/e2e-go/cli/goal/expect/goalExpectCommon.exp index e452fbfecc..b34fa25217 100644 --- a/test/e2e-go/cli/goal/expect/goalExpectCommon.exp +++ b/test/e2e-go/cli/goal/expect/goalExpectCommon.exp @@ -1408,12 +1408,29 @@ proc ::AlgorandGoal::InspectTransactionFile { TRX_FILE } { proc ::AlgorandGoal::RunPingpong {DURATION PINGPONG_OPTIONS TEST_PRIMARY_NODE_DIR} { set timeout [expr $DURATION + 60] if { [ catch { - set pingpong_base "pingpong run --duration $DURATION -d $TEST_PRIMARY_NODE_DIR --quiet " + set pingpong_base "pingpong run --duration $DURATION -d $TEST_PRIMARY_NODE_DIR " set pingpong_command [concat $pingpong_base $PINGPONG_OPTIONS] puts "starting pingpong test with command: $pingpong_command" + + # Track whether we're expecting app calls + set expecting_apps 0 + if {[string match "*--numapp*" $PINGPONG_OPTIONS]} { + set expecting_apps 1 + set saw_app_calls 0 + puts "Test expects app calls since --numapp is specified" + } + eval spawn $pingpong_command expect { timeout { puts "pingpong test interrupted by timeout, terminating after $timeout seconds" } + "no acct" {::AlgorandGoal::Abort "pingpong failed with 'no acct' error - likely sender not set in constructAppTxn"} + "Calling app" { + if {$expecting_apps} { + set saw_app_calls 1 + puts "Saw app call" + } + exp_continue + } -re {Sent (\d+) transactions \((\d+) attempted\).} { set actual $expect_out(1,string) ; set attempted $expect_out(2,string) ; @@ -1421,7 +1438,12 @@ proc ::AlgorandGoal::RunPingpong {DURATION PINGPONG_OPTIONS TEST_PRIMARY_NODE_DI if { $actual != $attempted } then { ::AlgorandGoal::Abort "Pingpong attempted to send $attempted transactions, but actual was $actual"; break;} exp_continue } - "Terminating after max run time of" {puts "end of ping pong test"} + "Terminating after max run time of" { + puts "end of ping pong test" + if {$expecting_apps && !$saw_app_calls} { + ::AlgorandGoal::Abort "Test with --numapp expected app calls but saw none - possible constructAppTxn bug" + } + } eof {::AlgorandGoal::Abort "pingpong terminated unexpectedly: $expect_out(buffer)"} "Error" {::AlgorandGoal::Abort "error running pingpong: $expect_out(buffer)"} } diff --git a/test/e2e-go/cli/goal/expect/pingpongAssetLargeTest.exp b/test/e2e-go/cli/goal/expect/pingpongAssetLargeTest.exp new file mode 100644 index 0000000000..e4d474ed15 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongAssetLargeTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "AssetLarge" "asset_transfer_large" "--tps 200 --numasset=10 --numaccounts 5 --refresh 10" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongAssetSmallTest.exp b/test/e2e-go/cli/goal/expect/pingpongAssetSmallTest.exp new file mode 100644 index 0000000000..c9fd7a5983 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongAssetSmallTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "AssetSmall" "asset_transfer_small" "--tps 200 --numasset=5 --numaccounts 5 --refresh 10" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongAtomicLargeTest.exp b/test/e2e-go/cli/goal/expect/pingpongAtomicLargeTest.exp new file mode 100644 index 0000000000..b4761cb673 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongAtomicLargeTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "AtomicLarge" "atomic_transfer_large" "--groupsize=12 --tps 200 --refresh 10 --numaccounts 50" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongAtomicSmallTest.exp b/test/e2e-go/cli/goal/expect/pingpongAtomicSmallTest.exp new file mode 100644 index 0000000000..da33db156b --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongAtomicSmallTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "AtomicSmall" "atomic_transfer_small" "--groupsize=5 --tps 200 --refresh 10 --numaccounts 50" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongBigOpsBigHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongBigOpsBigHashTest.exp new file mode 100644 index 0000000000..8c90eb02c3 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongBigOpsBigHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "BigOpsBigHash" "bigops_bighash" "--appprogops 220 --appproghashes 10 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongBigOpsMediumHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongBigOpsMediumHashTest.exp new file mode 100644 index 0000000000..a2be6354f3 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongBigOpsMediumHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "BigOpsMediumHash" "bigops_mediumhash" "--appprogops 300 --appproghashes 5 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongBigOpsSmallHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongBigOpsSmallHashTest.exp new file mode 100644 index 0000000000..f076007479 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongBigOpsSmallHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "BigOpsSmallHash" "bigops_smallhash" "--appprogops 500 --appproghashes 2 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongCommon.exp b/test/e2e-go/cli/goal/expect/pingpongCommon.exp new file mode 100644 index 0000000000..7f6c1f0f32 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongCommon.exp @@ -0,0 +1,98 @@ +#!/usr/bin/expect -f +# Common utilities for pingpong tests +# This file should be sourced by individual pingpong test files + +source goalExpectCommon.exp + +# Setup a pingpong test network and return network info +proc setupPingpongNetwork { TEST_ALGO_DIR TEST_DATA_DIR } { + set timeout 60 + set TIME_STAMP [clock seconds] + + set TEST_ROOT_DIR $TEST_ALGO_DIR/root_$TIME_STAMP + set TEST_PRIMARY_NODE_DIR $TEST_ROOT_DIR/Primary/ + set NETWORK_NAME test_net_expect_$TIME_STAMP + set NETWORK_TEMPLATE "$TEST_DATA_DIR/nettemplates/TwoNodes50EachFuture.json" + + # Copy genesis file + exec cp $TEST_DATA_DIR/../../installer/genesis/devnet/genesis.json $TEST_ALGO_DIR + + # Create and start network + ::AlgorandGoal::CreateNetwork $NETWORK_NAME $NETWORK_TEMPLATE $TEST_ALGO_DIR $TEST_ROOT_DIR + ::AlgorandGoal::StartNetwork $NETWORK_NAME $NETWORK_TEMPLATE $TEST_ROOT_DIR + + # Get network info + set PRIMARY_NODE_ADDRESS [ ::AlgorandGoal::GetAlgodNetworkAddress $TEST_PRIMARY_NODE_DIR ] + puts "Primary Node Address: $PRIMARY_NODE_ADDRESS" + + set PRIMARY_WALLET_NAME unencrypted-default-wallet + + # Determine primary account + set PRIMARY_ACCOUNT_ADDRESS [::AlgorandGoal::GetHighestFundedAccountForWallet $PRIMARY_WALLET_NAME $TEST_PRIMARY_NODE_DIR] + + # Check the balance of the primary account + set PRIMARY_ACCOUNT_BALANCE [::AlgorandGoal::GetAccountBalance $PRIMARY_WALLET_NAME $PRIMARY_ACCOUNT_ADDRESS $TEST_PRIMARY_NODE_DIR] + puts "Primary Account Balance: $PRIMARY_ACCOUNT_BALANCE" + + # Wait for round 1 to ensure network is ready + ::AlgorandGoal::WaitForRound 1 $TEST_PRIMARY_NODE_DIR + + # Return list of important values + return [list $TEST_ROOT_DIR $TEST_PRIMARY_NODE_DIR $NETWORK_NAME $PRIMARY_NODE_ADDRESS $PRIMARY_ACCOUNT_ADDRESS] +} + +# Teardown a pingpong test network +proc teardownPingpongNetwork { NETWORK_NAME TEST_ROOT_DIR } { + ::AlgorandGoal::StopNetwork $NETWORK_NAME $TEST_ROOT_DIR +} + +# Run a pingpong variation with the given arguments +proc runPingpongVariation { variation_name pingpong_args TEST_PRIMARY_NODE_DIR duration } { + puts "Running pingpong variation: $variation_name" + puts "Arguments: $pingpong_args" + puts "Duration: $duration seconds" + + ::AlgorandGoal::RunPingpong $duration $pingpong_args $TEST_PRIMARY_NODE_DIR +} + +# Common error handler for pingpong tests +proc pingpongTestErrorHandler { test_name exception } { + ::AlgorandGoal::Abort "ERROR in $test_name: $exception" +} + +# Main test runner that does all the work +proc runPingpongTest { test_name variation_name pingpong_args {duration 5} } { + global TEST_ALGO_DIR TEST_DATA_DIR + + # Setup network + set network_info [setupPingpongNetwork $TEST_ALGO_DIR $TEST_DATA_DIR] + set TEST_ROOT_DIR [lindex $network_info 0] + set TEST_PRIMARY_NODE_DIR [lindex $network_info 1] + set NETWORK_NAME [lindex $network_info 2] + + # Run the test + runPingpongVariation $variation_name $pingpong_args $TEST_PRIMARY_NODE_DIR $duration + + # Teardown network + teardownPingpongNetwork $NETWORK_NAME $TEST_ROOT_DIR + + puts "Pingpong $test_name Test Successful" +} + +# Main entry point for all pingpong tests +proc pingpongTestMain { test_name variation_name pingpong_args {duration 5} } { + global TEST_ALGO_DIR TEST_DATA_DIR + + if { [catch { + source goalExpectCommon.exp + puts "Starting $test_name" + puts "TEST_ALGO_DIR: $TEST_ALGO_DIR" + puts "TEST_DATA_DIR: $TEST_DATA_DIR" + + runPingpongTest $test_name $variation_name $pingpong_args $duration + + exit 0 + } EXCEPTION ] } { + pingpongTestErrorHandler $test_name $EXCEPTION + } +} \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongMediumOpsBigHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongMediumOpsBigHashTest.exp new file mode 100644 index 0000000000..fba694ebab --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongMediumOpsBigHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "MediumOpsBigHash" "mediumops_bighash" "--appprogops 200 --appproghashes 10 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongMediumOpsMediumHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongMediumOpsMediumHashTest.exp new file mode 100644 index 0000000000..22100006cb --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongMediumOpsMediumHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "MediumOpsMediumHash" "mediumops_mediumhash" "--appprogops 200 --appproghashes 5 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongMediumOpsSmallHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongMediumOpsSmallHashTest.exp new file mode 100644 index 0000000000..43387258dc --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongMediumOpsSmallHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "MediumOpsSmallHash" "mediumops_smallhash" "--appprogops 200 --appproghashes 2 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongPaymentTest.exp b/test/e2e-go/cli/goal/expect/pingpongPaymentTest.exp new file mode 100644 index 0000000000..eaa9729eeb --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongPaymentTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "Payment" "payment_transaction" "--tps 200 --refresh 10 --numaccounts 50" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongRekeyTest.exp b/test/e2e-go/cli/goal/expect/pingpongRekeyTest.exp new file mode 100644 index 0000000000..6850186119 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongRekeyTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "Rekey" "rekey_payment_transaction" "--rekey=true --groupsize=2 --randomnote=true --tps 200 --refresh 10 --numaccounts 50" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongSmallOpsBigHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongSmallOpsBigHashTest.exp new file mode 100644 index 0000000000..2f6a5d8f61 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongSmallOpsBigHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "SmallOpsBigHash" "smallops_bighash" "--appprogops 2 --appproghashes 10 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongSmallOpsMediumHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongSmallOpsMediumHashTest.exp new file mode 100644 index 0000000000..60a8621d88 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongSmallOpsMediumHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "SmallOpsMediumHash" "smallops_mediumhash" "--appprogops 2 --appproghashes 5 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongSmallOpsSmallHashTest.exp b/test/e2e-go/cli/goal/expect/pingpongSmallOpsSmallHashTest.exp new file mode 100644 index 0000000000..b6b9ad973b --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongSmallOpsSmallHashTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "SmallOpsSmallHash" "smallops_smallhash" "--appprogops 2 --appproghashes 2 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 5 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongStatefulBoxReadTest.exp b/test/e2e-go/cli/goal/expect/pingpongStatefulBoxReadTest.exp new file mode 100644 index 0000000000..fbd706bbe1 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongStatefulBoxReadTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "StatefulBoxRead" "stateful_box_read" "--numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000 --numboxread 5" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongStatefulBoxUpdateTest.exp b/test/e2e-go/cli/goal/expect/pingpongStatefulBoxUpdateTest.exp new file mode 100644 index 0000000000..697275025c --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongStatefulBoxUpdateTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "StatefulBoxUpdate" "stateful_box_update" "--numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000 --numboxupdate 5" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongStatefulLargeTest.exp b/test/e2e-go/cli/goal/expect/pingpongStatefulLargeTest.exp new file mode 100644 index 0000000000..53287aacfa --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongStatefulLargeTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "StatefulLarge" "stateful_teal_large" "--numapp 10 --appprogops 695 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongStatefulMediumTest.exp b/test/e2e-go/cli/goal/expect/pingpongStatefulMediumTest.exp new file mode 100644 index 0000000000..ba8d304e13 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongStatefulMediumTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "StatefulMedium" "stateful_teal_medium" "--numapp 10 --appprogops 200 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongStatefulSmallTest.exp b/test/e2e-go/cli/goal/expect/pingpongStatefulSmallTest.exp new file mode 100644 index 0000000000..3797b5edc8 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongStatefulSmallTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "StatefulSmall" "stateful_teal_small" "--numapp 10 --appprogops 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongTealHeavyTest.exp b/test/e2e-go/cli/goal/expect/pingpongTealHeavyTest.exp new file mode 100644 index 0000000000..6cc792e037 --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongTealHeavyTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "TealHeavy" "teal_heavy_transaction" "--teal=heavy --tps 200 --refresh 10 --numaccounts 50" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongTealLightTest.exp b/test/e2e-go/cli/goal/expect/pingpongTealLightTest.exp new file mode 100644 index 0000000000..bef557103b --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongTealLightTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "TealLight" "teal_light_transaction" "--teal=light --tps 200 --refresh 10 --numaccounts 50" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongTealNormalTest.exp b/test/e2e-go/cli/goal/expect/pingpongTealNormalTest.exp new file mode 100644 index 0000000000..f0d840ebbf --- /dev/null +++ b/test/e2e-go/cli/goal/expect/pingpongTealNormalTest.exp @@ -0,0 +1,5 @@ +#!/usr/bin/expect -f +set TEST_ALGO_DIR [lindex $argv 0] +set TEST_DATA_DIR [lindex $argv 1] +source pingpongCommon.exp +pingpongTestMain "TealNormal" "teal_normal_transaction" "--teal=normal --tps 200 --refresh 10 --numaccounts 50" \ No newline at end of file diff --git a/test/e2e-go/cli/goal/expect/pingpongTest.exp b/test/e2e-go/cli/goal/expect/pingpongTest.exp deleted file mode 100644 index 99fb9a3ee7..0000000000 --- a/test/e2e-go/cli/goal/expect/pingpongTest.exp +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/expect -f -#exp_internal 1 -set err 0 -log_user 1 - -source goalExpectCommon.exp - -set TEST_ALGO_DIR [lindex $argv 0] -set TEST_DATA_DIR [lindex $argv 1] - -proc pingpongTest { TEST_ALGO_DIR TEST_DATA_DIR} { - - set timeout 60 - set TIME_STAMP [clock seconds] - - set TEST_ROOT_DIR $TEST_ALGO_DIR/root_$TIME_STAMP - set TEST_PRIMARY_NODE_DIR $TEST_ROOT_DIR/Primary/ - set NETWORK_NAME test_net_expect_$TIME_STAMP - set NETWORK_TEMPLATE "$TEST_DATA_DIR/nettemplates/TwoNodes50EachFuture.json" - - exec cp $TEST_DATA_DIR/../../installer/genesis/devnet/genesis.json $TEST_ALGO_DIR - - # Create network - ::AlgorandGoal::CreateNetwork $NETWORK_NAME $NETWORK_TEMPLATE $TEST_ALGO_DIR $TEST_ROOT_DIR - - # Start network - ::AlgorandGoal::StartNetwork $NETWORK_NAME $NETWORK_TEMPLATE $TEST_ROOT_DIR - - set PRIMARY_NODE_ADDRESS [ ::AlgorandGoal::GetAlgodNetworkAddress $TEST_PRIMARY_NODE_DIR ] - puts "Primary Node Address: $PRIMARY_NODE_ADDRESS" - - set PRIMARY_WALLET_NAME unencrypted-default-wallet - - # Determine primary account - set PRIMARY_ACCOUNT_ADDRESS [::AlgorandGoal::GetHighestFundedAccountForWallet $PRIMARY_WALLET_NAME $TEST_PRIMARY_NODE_DIR] - - # Check the balance of the primary account - set PRIMARY_ACCOUNT_BALANCE [::AlgorandGoal::GetAccountBalance $PRIMARY_WALLET_NAME $PRIMARY_ACCOUNT_ADDRESS $TEST_PRIMARY_NODE_DIR] - puts "Primary Account Balance: $PRIMARY_ACCOUNT_BALANCE" - - ::AlgorandGoal::WaitForRound 1 $TEST_PRIMARY_NODE_DIR - - set TEAL_PROGS_DIR "$TEST_DATA_DIR/../scripts/e2e_subs/tealprogs" - - # Network Setup complete - #---------------------- - - # Run pingpong tests - #---------------------- - - - set pingpong_duration 5 - - set pingpongArray(1_smallops_smallhash) "--appprogops 2 --appproghashes 2 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 5 --minaccount 100000000" - set pingpongArray(2_smallops_mediumhash) "--appprogops 2 --appproghashes 5 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(3_smallops_bighash) "--appprogops 2 --appproghashes 10 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(4_mediumops_smallhash) "--appprogops 200 --appproghashes 2 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(5_mediumops_mediumhash) "--appprogops 200 --appproghashes 5 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(6_mediumops_bighash) "--appprogops 200 --appproghashes 10 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(7_bigops_smallhash) "--appprogops 500 --appproghashes 2 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(8_bigops_mediumhash) "--appprogops 300 --appproghashes 5 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(9_bigops_bighash) "--appprogops 220 --appproghashes 10 --appproghashsize sha512_256 --numapp 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - - set pingpongArray(10_payment_transaction) "--tps 200 --refresh 10 --numaccounts 50" - set pingpongArray(11_teal_light_transaction) "--teal=light --tps 200 --refresh 10 --numaccounts 50" - set pingpongArray(10_teal_normal_transaction) "--teal=normal --tps 200 --refresh 10 --numaccounts 50" - set pingpongArray(12_teal_heavy_transaction) "--teal=heavy --tps 200 --refresh 10 --numaccounts 50" - set pingpongArray(13_atomic_transfer_small_transaction) "--groupsize=5 --tps 200 --refresh 10 --numaccounts 50" - set pingpongArray(14_atomic_transfer_large_transaction) "--groupsize=12 --tps 200 --refresh 10 --numaccounts 50" - set pingpongArray(15_asset_transfer_small_transaction) "--tps 200 --numasset=5 --mf 0 --numaccounts 10 --refresh 10 --mf=1000" - set pingpongArray(16_asset_transfer_large_transaction) "--tps 200 --numasset=10 --mf 0 --numaccounts 10 --refresh 10 --mf=1000" - set pingpongArray(17_stateful_teal_small_transaction) "--numapp 10 --appprogops 10 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(18_stateful_teal_medium_transaction) "--numapp 10 --appprogops 200 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(19_stateful_teal_large_transaction) "--numapp 10 --appprogops 600 --tps 200 --refresh 10 --numaccounts 50 --minaccount 100000000" - set pingpongArray(20_rekey_payment_transaction) "--rekey=true --groupsize=2 --randomnote=true --tps 200 --refresh 10 --numaccounts 50" - - - foreach index [array names pingpongArray] { - puts "pingpongArray($index): $pingpongArray($index)" - ::AlgorandGoal::RunPingpong $pingpong_duration $pingpongArray($index) $TEST_PRIMARY_NODE_DIR - } - - # Shutdown the network - #---------------------- - ::AlgorandGoal::StopNetwork $NETWORK_NAME $TEST_ROOT_DIR - - puts "Pinpong Test Successful" - -} - - -if { [catch { - source goalExpectCommon.exp - - puts "starting pinpongTest" - - puts "TEST_ALGO_DIR: $TEST_ALGO_DIR" - puts "TEST_DATA_DIR: $TEST_DATA_DIR" - - pingpongTest $TEST_ALGO_DIR $TEST_DATA_DIR - - exit 0 - -} EXCEPTION ] } { - ::AlgorandGoal::Abort "ERROR in pinpongTest: $EXCEPTION" -} diff --git a/test/framework/fixtures/expectFixture.go b/test/framework/fixtures/expectFixture.go index 2c03a704bb..f27f3134cf 100644 --- a/test/framework/fixtures/expectFixture.go +++ b/test/framework/fixtures/expectFixture.go @@ -140,7 +140,6 @@ func skipExpectTests() bool { // Run Process all expect script files with suffix Test.exp within the current directory func (ef *ExpectFixture) Run() { disabledTest := map[string]string{ - "pingpongTest.exp": "broken", "listExpiredParticipationKeyTest.exp": "flaky", } for testName := range ef.expectFiles { @@ -194,7 +193,7 @@ func (ef *ExpectFixture) Run() { syncTest.Logf("err running '%s': %s\nstdout: %s\nstderr: %s\n", testName, err, outBuf, stderr) syncTest.Fail() } else { - // t.Logf("stdout: %s", string(outBuf.Bytes())) + syncTest.Logf("stdout: %s", string(outBuf.Bytes())) ef.removeTestDir(workingDir) } }) From b2ad7a51cce1519e9f5609aa17df4b649e8a6bbd Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Wed, 27 Aug 2025 22:09:56 -0400 Subject: [PATCH 3/5] add pingpong to CI build-e2e binaries --- Makefile | 2 +- test/e2e-go/cli/goal/expect/goalExpectCommon.exp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 759e13d5ca..750fe188f1 100644 --- a/Makefile +++ b/Makefile @@ -299,7 +299,7 @@ build-e2e: check-go-version crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a @mkdir -p $(GOBIN)-race # Build regular binaries (kmd, algod, goal) and race binaries in parallel $(GO_INSTALL) -trimpath $(GOTAGS) $(GOBUILDMODE) -ldflags="$(GOLDFLAGS)" ./cmd/kmd ./cmd/algod ./cmd/goal & \ - GOBIN=$(GOBIN)-race go install -trimpath $(GOTAGS) -race -ldflags="$(GOLDFLAGS)" ./cmd/goal ./cmd/algod ./cmd/algoh ./cmd/tealdbg ./cmd/msgpacktool ./cmd/algokey ./tools/teal/algotmpl ./test/e2e-go/cli/tealdbg/cdtmock & \ + GOBIN=$(GOBIN)-race go install -trimpath $(GOTAGS) -race -ldflags="$(GOLDFLAGS)" ./cmd/goal ./cmd/algod ./cmd/algoh ./cmd/tealdbg ./cmd/msgpacktool ./cmd/algokey ./cmd/pingpong ./tools/teal/algotmpl ./test/e2e-go/cli/tealdbg/cdtmock & \ wait cp $(GOBIN)/kmd $(GOBIN)-race diff --git a/test/e2e-go/cli/goal/expect/goalExpectCommon.exp b/test/e2e-go/cli/goal/expect/goalExpectCommon.exp index b34fa25217..4f3d8bedce 100644 --- a/test/e2e-go/cli/goal/expect/goalExpectCommon.exp +++ b/test/e2e-go/cli/goal/expect/goalExpectCommon.exp @@ -1422,8 +1422,14 @@ proc ::AlgorandGoal::RunPingpong {DURATION PINGPONG_OPTIONS TEST_PRIMARY_NODE_DI eval spawn $pingpong_command expect { - timeout { puts "pingpong test interrupted by timeout, terminating after $timeout seconds" } + timeout { ::AlgorandGoal::Abort "pingpong test interrupted by timeout after $timeout seconds" } "no acct" {::AlgorandGoal::Abort "pingpong failed with 'no acct' error - likely sender not set in constructAppTxn"} + -re {(?i)error[ :]} { + ::AlgorandGoal::Abort "pingpong encountered error: $expect_out(0,string)" + } + -re {(?i)panic} { + ::AlgorandGoal::Abort "pingpong panicked: $expect_out(0,string)" + } "Calling app" { if {$expecting_apps} { set saw_app_calls 1 From 17ed6b76e6850b97372927f271aa9fb8e8736558 Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Wed, 27 Aug 2025 22:14:47 -0400 Subject: [PATCH 4/5] fix lint --- test/framework/fixtures/expectFixture.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/framework/fixtures/expectFixture.go b/test/framework/fixtures/expectFixture.go index f27f3134cf..418a2bd6bd 100644 --- a/test/framework/fixtures/expectFixture.go +++ b/test/framework/fixtures/expectFixture.go @@ -193,7 +193,7 @@ func (ef *ExpectFixture) Run() { syncTest.Logf("err running '%s': %s\nstdout: %s\nstderr: %s\n", testName, err, outBuf, stderr) syncTest.Fail() } else { - syncTest.Logf("stdout: %s", string(outBuf.Bytes())) + syncTest.Logf("stdout: %s", outBuf.String()) ef.removeTestDir(workingDir) } }) From 706bf598449d05c0d2842469a70379a7d3030468 Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Thu, 28 Aug 2025 10:06:08 -0400 Subject: [PATCH 5/5] fix asset tests --- shared/pingpong/accounts.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared/pingpong/accounts.go b/shared/pingpong/accounts.go index 3b86e868a3..0fcbdbeaa1 100644 --- a/shared/pingpong/accounts.go +++ b/shared/pingpong/accounts.go @@ -385,6 +385,7 @@ func (pps *WorkerState) makeNewAssets(client *libgoal.Client) (err error) { return } assetsNeeded := int(pps.cfg.NumAsset) - len(pps.cinfo.AssetParams) + assetsToCreate := assetsNeeded // Save original count for later use newAssetAddrs := make(map[string]*pingPongAccount, assetsNeeded) for addr, acct := range pps.accounts { if assetsNeeded <= 0 { @@ -418,9 +419,9 @@ func (pps *WorkerState) makeNewAssets(client *libgoal.Client) (err error) { newAssetAddrs[addr] = acct } // wait for new assets to be created, fetch account data for them - newAssets := make(map[basics.AssetIndex]model.AssetParams, assetsNeeded) + newAssets := make(map[basics.AssetIndex]model.AssetParams, assetsToCreate) timeout := time.Now().Add(10 * time.Second) - for len(newAssets) < assetsNeeded { + for len(newAssets) < assetsToCreate { for addr, acct := range newAssetAddrs { ai, err := client.AccountInformation(addr, true) if err != nil {