Skip to content

Commit

Permalink
Fix pull subscribe test
Browse files Browse the repository at this point in the history
Signed-off-by: Waldemar Quevedo <wally@nats.io>
  • Loading branch information
wallyqs committed Apr 26, 2022
1 parent 61ca93d commit 7484f24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ async def handler(msg):

@async_test
async def test_reconnect_buf_disabled(self):
pytest.skip("flaky test)
pytest.skip("flaky test")
nc = NATS()
errors = []
reconnected = asyncio.Future()
Expand Down
7 changes: 7 additions & 0 deletions tests/test_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ async def test_subscribe_bind(self):
msg = await sub.next_msg()
msgs.append(msg)
await msg.ack()
await asyncio.sleep(0.2)
assert len(msgs) == 10
assert sub.pending_msgs == 0

Expand All @@ -927,8 +928,14 @@ async def test_double_acking_pull_subscribe(self):
# Pull Subscriber
psub = await js.pull_subscribe("test", "durable")
msgs = await psub.fetch(1)

info = await psub.consumer_info()
assert info.num_pending == 9
assert info.num_ack_pending == 1

msg = msgs[0]
await msg.ack()
await asyncio.sleep(0.5)
with pytest.raises(MsgAlreadyAckdError):
await msg.ack()

Expand Down

0 comments on commit 7484f24

Please sign in to comment.