@@ -60,7 +60,7 @@ def map_dict_fvm(s, d):
6060def test_receiver (event_obj , cnt ):
6161 global rc_test_receive
6262
63- sh = events_init_subscriber (false , RECEIVE_TIMEOUT , null )
63+ sh = events_init_subscriber (False , RECEIVE_TIMEOUT , None )
6464
6565 # Sleep ASYNC_CONN_WAIT to ensure async connectivity is complete.
6666 time .sleep (ASYNC_CONN_WAIT / 1000 )
@@ -75,19 +75,19 @@ def test_receiver(event_obj, cnt):
7575 p = event_receive_op_t ()
7676 rc = event_receive (sh , p )
7777
78- if rc > 0 & & publish_cnt < 2 :
78+ if rc > 0 and publish_cnt < 2 :
7979 # ignore timeout as test code has not yet published an event yet
8080 continue
8181
8282 if rc != 0 :
83- log_notice ("Failed to receive. {}/{} rc={}" .format (i , cnt , rc ))
83+ log_notice ("Failed to receive. {}/{} rc={}" .format (cnt_done , cnt , rc ))
8484 break
8585
8686 if test_event_key != p .key :
8787 # received a different event than published
8888 continue
8989
90- exp_params ["index" ] = str (i )
90+ exp_params ["index" ] = str (cnt_done )
9191 rcv_params = {}
9292 map_dict_fvm (p .params , rcv_params )
9393
@@ -102,19 +102,19 @@ def test_receiver(event_obj, cnt):
102102 rc = - 1
103103
104104 if (rc != 0 ):
105- log_notice ("params mismatch {}/{}" .format (i , cnt ))
105+ log_notice ("params mismatch {}/{}" .format (cnt_done , cnt ))
106106 break
107107
108108 if p .missed_cnt != 0 :
109- log_notice ("Expect missed_cnt {} == 0 {}/{}" .format (p .missed_cnt ,i , cnt ))
109+ log_notice ("Expect missed_cnt {} == 0 {}/{}" .format (p .missed_cnt , cnt_done , cnt ))
110110 break
111111
112112 if p .publish_epoch_ms == 0 :
113- log_notice ("Expect publish_epoch_ms != 0 {}/{}" .format (i , cnt ))
113+ log_notice ("Expect publish_epoch_ms != 0 {}/{}" .format (cnt_done , cnt ))
114114 break
115115
116116 cnt_done += 1
117- log_debug ("Received {}/{}" .format (i + 1 , cnt ))
117+ log_debug ("Received {}/{}" .format (cnt_done + 1 , cnt ))
118118
119119 if (cnt_done == cnt ):
120120 rc_test_receive = 0
@@ -127,6 +127,7 @@ def test_receiver(event_obj, cnt):
127127
128128
129129def publish_events (cnt ):
130+ global publish_cnt
130131 rc = - 1
131132 ph = events_init_publisher (test_source )
132133 if not ph :
@@ -148,6 +149,7 @@ def publish_events(cnt):
148149 if (rc != 0 ):
149150 log_notice ("Failed to publish. {}/{} rc={}" .format (i , cnt , rc ))
150151 break
152+
151153 log_debug ("published: {}/{}" .format (i + 1 , cnt ))
152154 publish_cnt += 1
153155
0 commit comments