Skip to content

Test langsmith flake fix (1000x per matrix)#1510

Draft
xumaple wants to merge 2 commits intomainfrom
maplexu/langsmith-flake-stress-test
Draft

Test langsmith flake fix (1000x per matrix)#1510
xumaple wants to merge 2 commits intomainfrom
maplexu/langsmith-flake-stress-test

Conversation

@xumaple
Copy link
Copy Markdown
Contributor

@xumaple xumaple commented May 8, 2026

DO NOT MERGE — temporary experiment branch

Validates whether removing max_cached_workflows=0 from test_temporal_prefixed_query_not_traced actually fixes the intermittent Windows 3.10 deadlock flake. Will be discarded after CI confirms the result.

What this PR does

  • Test fix: removes max_cached_workflows=0 from the worker config in the affected test.
  • Stress harness: parametrizes the test with range(1000) so each build-lint-test matrix entry runs it 1000 times via pytest-xdist.
  • CI scoping: in the build-lint-test job only, runs only this test, with pytest-rerunfailures disabled (so a single failure cannot be hidden by retries). All other test steps (time-skipping, openai), poe lint, and poe bridge-lint are commented out. Job timeout 60 min, step timeout 30 min.
  • Other top-level jobs (test-latest-deps, features-tests, check-protos, cloud-test) are untouched but irrelevant to this experiment.

Hypothesis under test

The deadlock fires inside _stack_trace's call to traceback.FrameSummary during the built-in __stack_trace query handler (see CI traces from prior repros on PRs #1454 and #1507). With max_cached_workflows=0, every query forces a full replay activation; combined with the per-frame linecache reads in _stack_trace and slow Windows runner I/O, the work occasionally exceeds the 2-second [TMPRL1101] deadlock window.

Removing max_cached_workflows=0 keeps the workflow in memory between queries, so query activations contain only the query job — no replay — and the 2s budget is no longer tight.

Pass criterion

Zero failures across all 10 matrix entries: {3.10, 3.14} × {ubuntu-latest, ubuntu-arm, macos-arm, macos-intel, windows-latest} = 10,000 total invocations.

Any single failure on any target = the cache=0 removal is not sufficient and a deeper fix (e.g., changes in _stack_trace itself, or longer deadlock budget for built-in queries) is needed.

Next steps

  • If green: apply just the test change (no CI/parametrize) to a clean branch, open the real fix PR, discard this branch.
  • If red: investigate the failure(s) and revisit the root cause.

Temporary experiment branch to validate that removing max_cached_workflows=0
from test_temporal_prefixed_query_not_traced fixes the Windows 3.10 deadlock
flake.

Changes:
- tests/contrib/langsmith/test_integration.py: parametrize the test with
  range(1000) so each matrix entry runs it 1000x via pytest-xdist; remove
  max_cached_workflows=0 from the worker config.
- .github/workflows/ci.yml (build-lint-test job only):
  - Run only the parametrized test with -p no:rerunfailures so a single
    failure is not hidden by retries.
  - Disable poe lint, poe bridge-lint, the time-skipping test step, and the
    openai test step for this branch.
  - Bump job timeout to 60 min.
  - Step timeout 30 min for the stress test.

Success = 0 failures across 10,000 invocations (10 matrix entries x 1000).
Any single failure means the cache=0 removal is not sufficient and a deeper
fix is needed.

This branch will be discarded once CI confirms the result. The actual fix
(test change only, no CI change) will go on a separate branch/PR.
@xumaple xumaple changed the title DO NOT MERGE: stress-test langsmith flake fix (1000x per matrix) OhTest langsmith flake fix (1000x per matrix) May 8, 2026
@xumaple xumaple changed the title OhTest langsmith flake fix (1000x per matrix) Test langsmith flake fix (1000x per matrix) May 8, 2026
Restore `max_cached_workflows=0` on the parametrized 1000x stress test
to verify the hypothesis from the other direction: with cache=0 in
place, Windows 3.10 should reproduce the [TMPRL1101] deadlock flake
within 1000 iterations.

Previous run (cache=0 removed) passed 1000/1000 on every matrix entry.
Expectation: this run will fail on Windows 3.10.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant