Skip to content

fix(ci): isolate model-loading fork tests - #6145

Open
mday-io wants to merge 2 commits into
SQLMesh:mainfrom
mday-io:fix/ci-fork-test-isolation
Open

mday-io wants to merge 2 commits into
SQLMesh:mainfrom
mday-io:fix/ci-fork-test-isolation

Conversation

@mday-io

@mday-io mday-io commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Model-loading fork tests intermittently segfault in Python 3.9 CI when they share a pytest process. Forked workers can inherit native state left by earlier tests.

Add a fork_isolated marker and run test_parallel_load and test_parallel_load_multi_repo in separate pytest processes in make fast-test, make slow-test, and make cicd-test.

Test Plan

  • Ran each fork test 30 times in a separate process on Linux with Python 3.9 and 3.12. All 120 runs passed. Runs of the whole test file also passed, so these checks do not prove the intermittent crash is eliminated.
  • Verified that the revised batches select the same tests with no omissions or duplicates.
  • Ran make style. Ran the full make fast-test command on the final PR commit on macOS with Python 3.12.13. All six pytest batches passed, with 2,860 tests passed in total, including both fork tests in separate processes.
  • GitHub CI passed the style and CI/CD tests on Python 3.9 through 3.13 and Windows. All checks that ran passed. Cloud engine tests and VS Code end-to-end tests were skipped.

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable)
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

Run fork tests in a fresh pytest process with collection limited to their module. This contains the intermittent baseline Linux worker crash seen after the other isolated tests without changing production multiprocessing behavior.

Signed-off-by: mday-io <mdaytn@gmail.com>
The whole-file batch still crashes in Python 3.9 after the first test passes. Give each existing fork test a fresh interpreter, preserving marker filters and assertions. Both test nodes passed 30 individual runs on Linux with Python 3.9 and 3.12.

Signed-off-by: mday-io <mdaytn@gmail.com>
@cmgoffena13
cmgoffena13 self-requested a review October 15, 2026 00:20
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.

2 participants