@@ -287,17 +287,24 @@ async def setup(self, use_binary_protocol):
287287 self .test_vars = await TestApp .get_test_vars ()
288288 self .use_binary_protocol = use_binary_protocol
289289
290+ protocol = 'msgpack' if use_binary_protocol else 'json'
291+
290292 self .client1 = await TestApp .get_ably_realtime (
291293 client_id = 'client1' ,
292294 use_binary_protocol = use_binary_protocol
293295 )
296+ print (f"[{ protocol } ] FIXTURE SETUP: Created client1 id={ id (self .client1 )} , state={ self .client1 .connection .state } " )
297+
294298 self .client2 = await TestApp .get_ably_realtime (
295299 client_id = 'client2' ,
296300 use_binary_protocol = use_binary_protocol
297301 )
302+ print (f"[{ protocol } ] FIXTURE SETUP: Created client2 id={ id (self .client2 )} , state={ self .client2 .connection .state } " )
298303
299304 yield
300305
306+ print (f"[{ protocol } ] FIXTURE TEARDOWN: client1 id={ id (self .client1 )} , state={ self .client1 .connection .state } " )
307+ print (f"[{ protocol } ] FIXTURE TEARDOWN: client2 id={ id (self .client2 )} , state={ self .client2 .connection .state } " )
301308 await self .client1 .close ()
302309 await self .client2 .close ()
303310
@@ -335,20 +342,27 @@ async def test_presence_message_action(self):
335342 """
336343 Test RTP8c: PresenceMessage should have correct action string.
337344 """
345+ protocol = 'msgpack' if self .use_binary_protocol else 'json'
346+ print (f"[{ protocol } ] TEST START: client1 id={ id (self .client1 )} , state={ self .client1 .connection .state } " )
347+
338348 channel_name = self .get_channel_name ('message_action' )
339349
340350 channel1 = self .client1 .channels .get (channel_name )
351+ print (f"[{ protocol } ] TEST: Got channel, client1.state={ self .client1 .connection .state } " )
341352
342353 received = asyncio .Future ()
343354
344355 def on_presence (msg ):
345356 received .set_result (msg )
346357
358+ print (f"[{ protocol } ] TEST: About to subscribe, client1.state={ self .client1 .connection .state } " )
347359 await channel1 .presence .subscribe (on_presence )
360+ print (f"[{ protocol } ] TEST: About to enter, client1.state={ self .client1 .connection .state } " )
348361 await channel1 .presence .enter ()
349362
350363 msg = await asyncio .wait_for (received , timeout = 5.0 )
351364 assert msg .action == PresenceAction .ENTER
365+ print (f"[{ protocol } ] TEST END: client1.state={ self .client1 .connection .state } " )
352366
353367
354368@pytest .mark .parametrize ('use_binary_protocol' , [True , False ], ids = ['msgpack' , 'json' ])
0 commit comments