Skip to content

Commit 20e58e0

Browse files
fix: separate fixture timeouts from test timeouts (#233)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: William Easton <[email protected]>
1 parent 8317d57 commit 20e58e0

File tree

4 files changed

+2
-10
lines changed

4 files changed

+2
-10
lines changed

key-value/key-value-aio/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ markers = [
6464
"skip_on_ci: Skip running the test when running on CI",
6565
]
6666
timeout = 10
67+
timeout_func_only = true
6768

6869
env_files = [".env"]
6970

key-value/key-value-aio/tests/stores/base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ async def eventually_consistent(self) -> None: # noqa: B027
3030
@abstractmethod
3131
async def store(self) -> BaseStore | AsyncGenerator[BaseStore, None]: ...
3232

33-
@pytest.mark.timeout(60)
3433
async def test_store(self, store: BaseStore):
3534
"""Tests that the store is a valid AsyncKeyValueProtocol."""
3635
assert isinstance(store, AsyncKeyValueProtocol) is True
@@ -181,7 +180,6 @@ async def test_negative_ttl(self, store: BaseStore):
181180
with pytest.raises(InvalidTTLError):
182181
await store.put(collection="test", key="test", value={"test": "test"}, ttl=-100)
183182

184-
@pytest.mark.timeout(10)
185183
async def test_put_expired_get_none(self, store: BaseStore):
186184
"""Tests that a put call with a negative ttl will return None when getting the key."""
187185
await store.put(collection="test_collection", key="test_key", value={"test": "test"}, ttl=2)
@@ -216,7 +214,6 @@ async def test_special_characters_in_key_name(self, store: BaseStore):
216214
await store.put(collection="test_collection", key="test_key!@#$%^&*()", value={"test": "test"})
217215
assert await store.get(collection="test_collection", key="test_key!@#$%^&*()") == {"test": "test"}
218216

219-
@pytest.mark.timeout(20)
220217
async def test_not_unbounded(self, store: BaseStore):
221218
"""Tests that the store is not unbounded."""
222219

@@ -246,15 +243,13 @@ async def worker(store: BaseStore, worker_id: int):
246243

247244
_ = await async_gather(*[worker(store, worker_id) for worker_id in range(5)])
248245

249-
@pytest.mark.timeout(15)
250246
async def test_minimum_put_many_get_many_performance(self, store: BaseStore):
251247
"""Tests that the store meets minimum performance requirements."""
252248
keys = [f"test_{i}" for i in range(10)]
253249
values = [{"test": f"test_{i}"} for i in range(10)]
254250
await store.put_many(collection="test_collection", keys=keys, values=values)
255251
assert await store.get_many(collection="test_collection", keys=keys) == values
256252

257-
@pytest.mark.timeout(15)
258253
async def test_minimum_put_many_delete_many_performance(self, store: BaseStore):
259254
"""Tests that the store meets minimum performance requirements."""
260255
keys = [f"test_{i}" for i in range(10)]

key-value/key-value-sync/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ markers = [
6363
"skip_on_ci: Skip running the test when running on CI",
6464
]
6565
timeout = 10
66+
timeout_func_only = true
6667

6768
env_files = [".env"]
6869

key-value/key-value-sync/tests/code_gen/stores/base.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def eventually_consistent(self) -> None: # noqa: B027
2727
@abstractmethod
2828
def store(self) -> BaseStore | Generator[BaseStore, None, None]: ...
2929

30-
@pytest.mark.timeout(60)
3130
def test_store(self, store: BaseStore):
3231
"""Tests that the store is a valid KeyValueProtocol."""
3332
assert isinstance(store, KeyValueProtocol) is True
@@ -178,7 +177,6 @@ def test_negative_ttl(self, store: BaseStore):
178177
with pytest.raises(InvalidTTLError):
179178
store.put(collection="test", key="test", value={"test": "test"}, ttl=-100)
180179

181-
@pytest.mark.timeout(10)
182180
def test_put_expired_get_none(self, store: BaseStore):
183181
"""Tests that a put call with a negative ttl will return None when getting the key."""
184182
store.put(collection="test_collection", key="test_key", value={"test": "test"}, ttl=2)
@@ -213,7 +211,6 @@ def test_special_characters_in_key_name(self, store: BaseStore):
213211
store.put(collection="test_collection", key="test_key!@#$%^&*()", value={"test": "test"})
214212
assert store.get(collection="test_collection", key="test_key!@#$%^&*()") == {"test": "test"}
215213

216-
@pytest.mark.timeout(20)
217214
def test_not_unbounded(self, store: BaseStore):
218215
"""Tests that the store is not unbounded."""
219216

@@ -243,15 +240,13 @@ def worker(store: BaseStore, worker_id: int):
243240

244241
_ = gather(*[worker(store, worker_id) for worker_id in range(5)])
245242

246-
@pytest.mark.timeout(15)
247243
def test_minimum_put_many_get_many_performance(self, store: BaseStore):
248244
"""Tests that the store meets minimum performance requirements."""
249245
keys = [f"test_{i}" for i in range(10)]
250246
values = [{"test": f"test_{i}"} for i in range(10)]
251247
store.put_many(collection="test_collection", keys=keys, values=values)
252248
assert store.get_many(collection="test_collection", keys=keys) == values
253249

254-
@pytest.mark.timeout(15)
255250
def test_minimum_put_many_delete_many_performance(self, store: BaseStore):
256251
"""Tests that the store meets minimum performance requirements."""
257252
keys = [f"test_{i}" for i in range(10)]

0 commit comments

Comments
 (0)