Skip to content

Commit

Permalink
more stringent values to ensure timeout tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
hemidactylus committed Mar 18, 2024
1 parent 979d088 commit 73e0573
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
16 changes: 7 additions & 9 deletions tests/idiomatic/integration/test_timeout_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,14 @@ async def test_insert_many_timeout_exceptions_async(
)

with pytest.raises(DataAPITimeoutException):
await async_collection.insert_many(
fifty_docs, ordered=True, max_time_ms=200
)
await async_collection.insert_many(fifty_docs, ordered=True, max_time_ms=2)
with pytest.raises(DataAPITimeoutException):
await async_collection.insert_many(
fifty_docs, ordered=False, concurrency=1, max_time_ms=200
fifty_docs, ordered=False, concurrency=1, max_time_ms=2
)
with pytest.raises(DataAPITimeoutException):
await async_collection.insert_many(
fifty_docs, ordered=False, concurrency=2, max_time_ms=200
fifty_docs, ordered=False, concurrency=2, max_time_ms=2
)

@pytest.mark.describe("test of update_many timeouts, async")
Expand All @@ -137,7 +135,7 @@ async def test_update_many_timeout_exceptions_async(

with pytest.raises(DataAPITimeoutException):
await async_collection.update_many(
{"f": "update_many"}, {"$inc": {"seq": 100}}, max_time_ms=200
{"f": "update_many"}, {"$inc": {"seq": 100}}, max_time_ms=2
)

@pytest.mark.describe("test of delete_many timeouts, async")
Expand All @@ -157,7 +155,7 @@ async def test_delete_many_timeout_exceptions_async(
await async_collection.delete_many({"f": "delete_many1"})
await async_collection.delete_many({"f": "delete_many2"}, max_time_ms=20000)
with pytest.raises(DataAPITimeoutException):
await async_collection.delete_many({"f": "delete_many3"}, max_time_ms=200)
await async_collection.delete_many({"f": "delete_many3"}, max_time_ms=2)

@pytest.mark.describe("test of bulk_write timeouts, async")
async def test_bulk_write_ordered_timeout_exceptions_async(
Expand All @@ -174,7 +172,7 @@ async def test_bulk_write_ordered_timeout_exceptions_async(
)
with pytest.raises(DataAPITimeoutException):
await async_empty_collection.bulk_write(
[im_a, im_b, dm], ordered=True, max_time_ms=500
[im_a, im_b, dm], ordered=True, max_time_ms=5
)

@pytest.mark.describe("test of bulk_write timeouts, async")
Expand All @@ -192,5 +190,5 @@ async def test_bulk_write_unordered_timeout_exceptions_async(
)
with pytest.raises(DataAPITimeoutException):
await async_empty_collection.bulk_write(
[im_a, im_b, dm], ordered=False, max_time_ms=500
[im_a, im_b, dm], ordered=False, max_time_ms=5
)
12 changes: 6 additions & 6 deletions tests/idiomatic/integration/test_timeout_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ def test_insert_many_timeout_exceptions_sync(
)

with pytest.raises(DataAPITimeoutException):
sync_collection.insert_many(fifty_docs, ordered=True, max_time_ms=200)
sync_collection.insert_many(fifty_docs, ordered=True, max_time_ms=2)
with pytest.raises(DataAPITimeoutException):
sync_collection.insert_many(
fifty_docs, ordered=False, concurrency=1, max_time_ms=200
fifty_docs, ordered=False, concurrency=1, max_time_ms=2
)
with pytest.raises(DataAPITimeoutException):
sync_collection.insert_many(
fifty_docs, ordered=False, concurrency=2, max_time_ms=200
fifty_docs, ordered=False, concurrency=2, max_time_ms=2
)

@pytest.mark.describe("test of update_many timeouts, sync")
Expand All @@ -133,7 +133,7 @@ def test_update_many_timeout_exceptions_sync(

with pytest.raises(DataAPITimeoutException):
sync_collection.update_many(
{"f": "update_many"}, {"$inc": {"seq": 100}}, max_time_ms=200
{"f": "update_many"}, {"$inc": {"seq": 100}}, max_time_ms=2
)

@pytest.mark.describe("test of delete_many timeouts, sync")
Expand All @@ -153,7 +153,7 @@ def test_delete_many_timeout_exceptions_sync(
sync_collection.delete_many({"f": "delete_many1"})
sync_collection.delete_many({"f": "delete_many2"}, max_time_ms=20000)
with pytest.raises(DataAPITimeoutException):
sync_collection.delete_many({"f": "delete_many3"}, max_time_ms=200)
sync_collection.delete_many({"f": "delete_many3"}, max_time_ms=2)

@pytest.mark.describe("test of bulk_write timeouts, sync")
def test_bulk_write_ordered_timeout_exceptions_sync(
Expand Down Expand Up @@ -188,5 +188,5 @@ def test_bulk_write_unordered_timeout_exceptions_sync(
)
with pytest.raises(DataAPITimeoutException):
sync_empty_collection.bulk_write(
[im_a, im_b, dm], ordered=False, max_time_ms=500
[im_a, im_b, dm], ordered=False, max_time_ms=5
)

0 comments on commit 73e0573

Please sign in to comment.