Skip to content

Commit bc8a33d

Browse files
authored
Merge branch 'main' into warn-unbound-activity-method
2 parents bf3a318 + e47c962 commit bc8a33d

3 files changed

Lines changed: 26 additions & 7 deletions

File tree

‎tests/conftest.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import gc
23
import multiprocessing.context
34
import os
45
import sys
@@ -58,6 +59,12 @@ def pytest_runtest_setup(item): # type: ignore[reportMissingParameterType]
5859
print()
5960

6061

62+
def pytest_collection_finish() -> None:
63+
# Freeze the import-time heap once so full GC passes only cover test allocations
64+
gc.collect()
65+
gc.freeze()
66+
67+
6168
def pytest_addoption(parser): # type: ignore[reportMissingParameterType]
6269
parser.addoption(
6370
"-E",

‎tests/contrib/langgraph/test_replay.py‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import warnings
23
from datetime import timedelta
34
from uuid import uuid4
45

@@ -52,10 +53,21 @@ async def test_replay(client: Client):
5253
)
5354
await handle.result()
5455

55-
await Replayer(
56-
workflows=[TwoNodesWorkflow],
57-
plugins=[plugin],
58-
).replay_workflow(await handle.fetch_history())
56+
with warnings.catch_warnings(record=True) as recorder:
57+
warnings.filterwarnings(
58+
"always", message=r"Module .* was imported after initial workflow load"
59+
)
60+
await Replayer(
61+
workflows=[TwoNodesWorkflow],
62+
plugins=[plugin],
63+
).replay_workflow(await handle.fetch_history())
64+
65+
# Sandbox imports during an activation count toward the deadlock timeout
66+
assert not [
67+
str(w.message)
68+
for w in recorder
69+
if "was imported after initial workflow load" in str(w.message)
70+
]
5971

6072

6173
@pytest.mark.skipif(

‎uv.lock‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)