@@ -16,6 +16,7 @@ use sui_types::programmable_transaction_builder::ProgrammableTransactionBuilder;
1616use sui_types:: transaction:: { CallArg , ObjectArg , SharedObjectMutability , TransactionData } ;
1717use sui_types:: { SUI_DENY_LIST_OBJECT_ID , SUI_FRAMEWORK_PACKAGE_ID } ;
1818use test_cluster:: { TestCluster , TestClusterBuilder } ;
19+ use tracing:: info;
1920
2021const DENY_ADDRESS : SuiAddress = SuiAddress :: ZERO ;
2122
@@ -34,13 +35,13 @@ async fn per_epoch_config_stress_test() {
3435 let handle1 = {
3536 let test_env = test_env. clone ( ) ;
3637 tokio:: spawn ( async move {
37- run_thread ( test_env, target_epoch, gas1. 0 , create_transfer_tx, true ) . await
38+ run_thread ( 1 , test_env, target_epoch, gas1. 0 , create_transfer_tx, true ) . await
3839 } )
3940 } ;
4041 let handle2 = {
4142 let test_env = test_env. clone ( ) ;
4243 tokio:: spawn ( async move {
43- run_thread ( test_env, target_epoch, gas2. 0 , create_deny_tx, false ) . await
44+ run_thread ( 2 , test_env, target_epoch, gas2. 0 , create_deny_tx, false ) . await
4445 } )
4546 } ;
4647 tokio:: time:: timeout ( Duration :: from_secs ( 600 ) , async {
@@ -52,6 +53,7 @@ async fn per_epoch_config_stress_test() {
5253}
5354
5455async fn run_thread < F , Fut > (
56+ thread_id : u64 ,
5557 test_env : Arc < TestEnv > ,
5658 target_epoch : EpochId ,
5759 gas_id : ObjectID ,
@@ -61,12 +63,15 @@ async fn run_thread<F, Fut>(
6163 F : Fn ( Arc < TestEnv > , ObjectRef ) -> Fut ,
6264 Fut : Future < Output = TransactionData > ,
6365{
66+ info ! ( ?thread_id, "Thread started" ) ;
6467 let mut num_tx_succeeded = 0 ;
6568 let mut num_tx_failed = 0 ;
6669 loop {
6770 let gas = test_env. get_latest_object_ref ( & gas_id) . await ;
6871 let tx_data = tx_creation_func ( test_env. clone ( ) , gas) . await ;
6972 let tx = test_env. test_cluster . sign_transaction ( & tx_data) . await ;
73+ let tx_digest = * tx. digest ( ) ;
74+ info ! ( ?thread_id, ?tx_digest, "Sending transaction" ) ;
7075 let Ok ( effects) = test_env
7176 . test_cluster
7277 . wallet
@@ -79,19 +84,32 @@ async fn run_thread<F, Fut>(
7984 continue ;
8085 } ;
8186 if effects. status ( ) . is_ok ( ) {
87+ info ! ( ?thread_id, ?tx_digest, "Transaction succeeded" ) ;
8288 num_tx_succeeded += 1 ;
8389 } else {
90+ info ! ( ?thread_id, ?tx_digest, "Transaction failed" ) ;
8491 num_tx_failed += 1 ;
8592 }
8693 let executed_epoch = effects. executed_epoch ( ) ;
8794 if executed_epoch >= target_epoch {
95+ info ! (
96+ ?thread_id,
97+ "Reached target epoch {target_epoch}. Current {executed_epoch}."
98+ ) ;
8899 break ;
89100 }
90101 }
91102 if !tx_may_fail {
92103 assert_eq ! ( num_tx_failed, 0 ) ;
93104 }
94- assert ! ( num_tx_succeeded + num_tx_failed > 5 ) ;
105+ assert ! (
106+ num_tx_succeeded + num_tx_failed > 5 ,
107+ "Thread {thread_id} succeeded {num_tx_succeeded} transactions and failed {num_tx_failed} transactions"
108+ ) ;
109+ info ! (
110+ ?thread_id,
111+ "Thread {thread_id} finished. Succeeded {num_tx_succeeded} transactions and failed {num_tx_failed} transactions."
112+ ) ;
95113}
96114
97115async fn create_deny_tx ( test_env : Arc < TestEnv > , gas : ObjectRef ) -> TransactionData {
0 commit comments