@@ -113,6 +113,7 @@ def delayed_send():
113113 elasticapm_client .begin_transaction ("foo" )
114114 producer .send ("test" , key = b"foo" , value = b"bar" )
115115 producer .send ("test" , key = b"baz" , value = b"bazzinga" )
116+ producer .flush ()
116117 elasticapm_client .end_transaction ("foo" )
117118
118119 thread = threading .Thread (target = delayed_send )
@@ -139,6 +140,7 @@ def delayed_send():
139140 elasticapm_client .begin_transaction ("foo" )
140141 producer .send ("test" , key = b"foo" , value = b"bar" )
141142 producer .send ("test" , key = b"baz" , value = b"bazzinga" )
143+ producer .flush ()
142144 elasticapm_client .end_transaction ("foo" )
143145
144146 thread = threading .Thread (target = delayed_send )
@@ -166,6 +168,7 @@ def delayed_send():
166168 producer .send (topic = "foo" , key = b"foo" , value = b"bar" )
167169 producer .send ("bar" , key = b"foo" , value = b"bar" )
168170 producer .send ("test" , key = b"foo" , value = b"bar" )
171+ producer .flush ()
169172
170173 thread = threading .Thread (target = delayed_send )
171174 thread .start ()
@@ -186,6 +189,7 @@ def delayed_send():
186189 producer .send (topic = "foo" , key = b"foo" , value = b"bar" )
187190 producer .send ("bar" , key = b"foo" , value = b"bar" )
188191 producer .send ("test" , key = b"foo" , value = b"bar" )
192+ producer .flush ()
189193
190194 thread = threading .Thread (target = delayed_send )
191195 thread .start ()
@@ -205,6 +209,7 @@ def delayed_send():
205209 time .sleep (0.2 )
206210 producer .send ("test" , key = b"foo" , value = b"bar" )
207211 producer .send ("test" , key = b"baz" , value = b"bazzinga" )
212+ producer .flush ()
208213
209214 thread = threading .Thread (target = delayed_send )
210215 thread .start ()
@@ -249,6 +254,7 @@ def test_kafka_consumer_unsampled_transaction_handles_stop_iteration(
249254 def delayed_send ():
250255 time .sleep (0.2 )
251256 producer .send ("test" , key = b"foo" , value = b"bar" )
257+ producer .flush ()
252258
253259 thread = threading .Thread (target = delayed_send )
254260 thread .start ()
0 commit comments