diff --git a/libs/langgraph/tests/test_pregel.py b/libs/langgraph/tests/test_pregel.py index 19db1a992..74dfa2e85 100644 --- a/libs/langgraph/tests/test_pregel.py +++ b/libs/langgraph/tests/test_pregel.py @@ -9823,12 +9823,18 @@ def edit(state: JokeState): graph = builder.compile(checkpointer=checkpointer) config = {"configurable": {"thread_id": "1"}} + tracer = FakeTracer() # invoke and pause at nested interrupt - assert graph.invoke({"subjects": ["cats", "dogs"]}, config=config) == { + assert graph.invoke( + {"subjects": ["cats", "dogs"]}, config={**config, "callbacks": [tracer]} + ) == { "subjects": ["cats", "dogs"], "jokes": [], } + assert len(tracer.runs) == 1, "Should produce exactly 1 root run" + + # check state outer_state = graph.get_state(config) assert outer_state == StateSnapshot( values={"subjects": ["cats", "dogs"], "jokes": []}, diff --git a/libs/langgraph/tests/test_pregel_async.py b/libs/langgraph/tests/test_pregel_async.py index f0a81ceb0..f33532c0c 100644 --- a/libs/langgraph/tests/test_pregel_async.py +++ b/libs/langgraph/tests/test_pregel_async.py @@ -8467,15 +8467,19 @@ async def edit(state: JokeState): async with awith_checkpointer(checkpointer_name) as checkpointer: graph = builder.compile(checkpointer=checkpointer) config = {"configurable": {"thread_id": "1"}} + tracer = FakeTracer() # invoke and pause at nested interrupt - assert await graph.ainvoke({"subjects": ["cats", "dogs"]}, config=config) == { + assert await graph.ainvoke( + {"subjects": ["cats", "dogs"]}, config={**config, "callbacks": [tracer]} + ) == { "subjects": ["cats", "dogs"], "jokes": [], } + assert len(tracer.runs) == 1, "Should produce exactly 1 root run" + # check state outer_state = await graph.aget_state(config) - assert outer_state == StateSnapshot( values={"subjects": ["cats", "dogs"], "jokes": []}, tasks=(