Skip to content

Commit

Permalink
Speed up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Dec 4, 2024
1 parent dcc2617 commit 771b9b2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_test_langgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
env:
LANGGRAPH_FF_SEND_V2: ${{ matrix.ff-send-v2 }}
run: |
make test
make test_parallel
- name: Ensure the tests did not create any additional files
shell: bash
Expand Down
6 changes: 6 additions & 0 deletions libs/langgraph/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ test:
make stop-postgres; \
exit $$EXIT_CODE

test_parallel:
make start-postgres && poetry run pytest -n auto --dist worksteal $(TEST); \
EXIT_CODE=$$?; \
make stop-postgres; \
exit $$EXIT_CODE

WORKERS ?= auto
XDIST_ARGS := $(if $(WORKERS),-n $(WORKERS) --dist worksteal,)
MAXFAIL ?=
Expand Down
1 change: 0 additions & 1 deletion libs/langgraph/tests/test_pregel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,6 @@ def route_to_three(state) -> Literal["3"]:
)


@pytest.mark.repeat(20)
@pytest.mark.parametrize("checkpointer_name", ALL_CHECKPOINTERS_SYNC)
def test_send_dedupe_on_resume(
request: pytest.FixtureRequest, checkpointer_name: str
Expand Down
3 changes: 0 additions & 3 deletions libs/langgraph/tests/test_pregel_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ async def iambad(input: State) -> None:
assert awhiles == 1


@pytest.mark.repeat(10)
async def test_step_timeout_on_stream_hang() -> None:
inner_task_cancelled = False

Expand Down Expand Up @@ -2559,7 +2558,6 @@ async def route_to_three(state) -> Literal["3"]:
)


@pytest.mark.repeat(10)
@pytest.mark.parametrize("checkpointer_name", ALL_CHECKPOINTERS_ASYNC)
async def test_send_sequences(checkpointer_name: str) -> None:
class Node:
Expand Down Expand Up @@ -2649,7 +2647,6 @@ async def route_to_three(state) -> Literal["3"]:
]


@pytest.mark.repeat(20)
@pytest.mark.parametrize("checkpointer_name", ALL_CHECKPOINTERS_ASYNC)
async def test_send_dedupe_on_resume(checkpointer_name: str) -> None:
if not FF_SEND_V2:
Expand Down

0 comments on commit 771b9b2

Please sign in to comment.