-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #493 from nats-io/ci-updates
CI updates
- Loading branch information
Showing
5 changed files
with
32 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,7 +348,7 @@ async def subscription_handler(msg): | |
|
||
async def subscription_handler2(msg): | ||
msgs2.append(msg) | ||
if len(msgs2) >= 1: | ||
if len(msgs2) >= 1 and not fut.done(): | ||
fut.set_result(True) | ||
|
||
await nc.connect(no_echo=True) | ||
|
@@ -1274,8 +1274,6 @@ async def err_cb(e): | |
|
||
@async_test | ||
async def test_closing_tasks(self): | ||
nc = NATS() | ||
|
||
disconnected_count = 0 | ||
errors = [] | ||
closed_future = asyncio.Future() | ||
|
@@ -1298,12 +1296,11 @@ async def err_cb(e): | |
'disconnected_cb': disconnected_cb, | ||
'error_cb': err_cb, | ||
'closed_cb': closed_cb, | ||
'servers': ["nats://foo:[email protected]:4223"], | ||
'max_reconnect_attempts': 3, | ||
'dont_randomize': True, | ||
} | ||
|
||
await nc.connect(**options) | ||
nc = await nats.connect("nats://foo:[email protected]:4223", **options) | ||
self.assertTrue(nc.is_connected) | ||
|
||
# Do a sudden close and wrap up test. | ||
|
@@ -1316,7 +1313,7 @@ async def err_cb(e): | |
for task in asyncio.all_tasks(): | ||
if not task.done(): | ||
pending_tasks_count += 1 | ||
self.assertEqual(expected_tasks, pending_tasks_count) | ||
self.assertTrue(pending_tasks_count <= expected_tasks) | ||
|
||
@async_test | ||
async def test_pending_data_size_flush_reconnect(self): | ||
|
@@ -2666,6 +2663,11 @@ async def test_protocol_mixing(self): | |
|
||
@async_test | ||
async def test_drain_cancelled_errors_raised(self): | ||
try: | ||
from unittest.mock import AsyncMock | ||
except ImportError: | ||
pytest.skip("skip since cannot use AsyncMock") | ||
|
||
nc = NATS() | ||
await nc.connect() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters