Skip to content

Commit d1da75b

Browse files
committed
test
1 parent b850fb6 commit d1da75b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ably/realtime/realtimepresence.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ async def subscribe(self, *args) -> None:
470470
"""
471471
# RTP6d: Implicitly attach
472472
if self.channel.state in [ChannelState.INITIALIZED, ChannelState.DETACHED, ChannelState.DETACHING]:
473-
asyncio.create_task(self.channel.attach())
473+
await self.channel.attach()
474474

475475
# Parse arguments: similar to channel subscribe
476476
if len(args) == 1:

test/ably/realtime/realtimepresence_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,12 @@ class TestRealtimePresenceSubscribe(BaseAsyncTestCase):
288288
@pytest.fixture(autouse=True)
289289
async def setup(self, use_binary_protocol, request):
290290
"""Set up test fixtures."""
291+
protocol = 'msgpack' if use_binary_protocol else 'json'
291292
test_instance = request.instance
293+
print(f"[{protocol}] FIXTURE: request.instance = {test_instance}, id = {id(test_instance) if test_instance else 'None'}")
294+
295+
if test_instance is None:
296+
raise RuntimeError(f"[{protocol}] FIXTURE ERROR: request.instance is None!")
292297

293298
test_instance.test_vars = await TestApp.get_test_vars()
294299
test_instance.use_binary_protocol = use_binary_protocol
@@ -352,10 +357,6 @@ def on_presence(msg):
352357
received.set_result(msg)
353358

354359
await channel1.presence.subscribe(on_presence)
355-
356-
# Wait for channel to attach before entering to avoid race with SYNC
357-
await channel1.attach()
358-
359360
await channel1.presence.enter()
360361

361362
msg = await asyncio.wait_for(received, timeout=5.0)

0 commit comments

Comments
 (0)