Title: Unit test installs kserve into the live interpreter, causing nondeterministic failures in unrelated tests · Issue #6732 · feast-dev/feast · GitHub
Open Graph Title: Unit test installs kserve into the live interpreter, causing nondeterministic failures in unrelated tests · Issue #6732 · feast-dev/feast
X Title: Unit test installs kserve into the live interpreter, causing nondeterministic failures in unrelated tests · Issue #6732 · feast-dev/feast
Description: Expected Behavior Running the unit suite leaves the environment it ran in unchanged, and a test's outcome does not depend on what other tests are doing concurrently. Current Behavior sdk/python/tests/unit/infra/test_dependency_conflicts....
Open Graph Description: Expected Behavior Running the unit suite leaves the environment it ran in unchanged, and a test's outcome does not depend on what other tests are doing concurrently. Current Behavior sdk/python/tes...
X Description: Expected Behavior Running the unit suite leaves the environment it ran in unchanged, and a test's outcome does not depend on what other tests are doing concurrently. Current Behavior sdk/python...
Opengraph URL: https://github.com/feast-dev/feast/issues/6732
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unit test installs kserve into the live interpreter, causing nondeterministic failures in unrelated tests","articleBody":"## Expected Behavior\n\nRunning the unit suite leaves the environment it ran in unchanged, and a test's outcome does not depend on what other tests are doing concurrently.\n\n## Current Behavior\n\n`sdk/python/tests/unit/infra/test_dependency_conflicts.py` installs a package into the interpreter that is running the suite:\n\n```python\ncommand = [sys.executable, \"-m\", \"pip\", \"install\", \"kserve==0.15.2\"]\n```\n\nThere is no isolation and no cleanup, so this mutates the environment every other test is using. Two consequences.\n\n**Unrelated tests fail nondeterministically in the same run.** `pyproject.toml` pins `psutil==5.9.0`; kserve 0.15.2 requires `psutil\u003c6.0.0,>=5.9.6`. pip therefore cannot leave the installed version in place — it uninstalls psutil, then installs 5.9.8:\n\n```\nAttempting uninstall: psutil\n Found existing installation: psutil 5.9.0\n Uninstalling psutil-5.9.0:\n Successfully uninstalled psutil-5.9.0\nInstalling collected packages: … psutil …\n```\n\n`make test-python-unit` runs `pytest -n 8`, so eight workers share one environment. Any test running during that window which imports psutil, directly or through a subprocess, fails. `feast/metrics.py` imports psutil at module scope, and `feast/cli/cli.py` reaches it through `feast/__init__.py`, so every test that shells out to the CLI is exposed.\n\nObserved on an unrelated docs PR, in `unit-test-python (3.12, ubuntu-latest)`:\n\n```\nFAILED sdk/python/tests/unit/cli/test_cli.py::test_3rd_party_providers\nAssertionError: Expected \u003cb'Traceback (most recent call last):\n File \".../feast/cli/cli.py\", line 27, in \u003cmodule>\n from feast import utils\n ...\n File \".../feast/metrics.py\", line 57, in \u003cmodule>\n import psutil\nModuleNotFoundError: No module named \\'psutil\\'\n'> to contain item \u003cb\"Provider \\'feast123\\' is not implemented\">\n```\n\nIn that job `test_install_kserve_with_feast` completed at 12:25:54 and the failure landed at 12:29:15. Because it depends on worker timing, a re-run usually passes, so it presents as flake and the blame lands on whichever PR happens to be running.\n\n**A second consecutive local run fails.** kserve also pulls protobuf down to 4.25.x, and the installed `grpcio-health-checking` ships protobuf 6.x generated code that imports `google.protobuf.runtime_version`. The first run still passes, because pytest imports every module during collection before the mid-run install lands; the next run fails at collection with `ImportError: cannot import name 'runtime_version' from 'google.protobuf'`. CI does not see this because its environments are ephemeral.\n\n## Steps to reproduce\n\n```\nmake test-python-unit # passes\nmake test-python-unit # collection errors on runtime_version\n```\n\nFor the race, run the suite with `-n 8` and observe that any test shelling out to the CLI can fail while the kserve install is between uninstall and install.\n\n### Specifications\n\n- Version: master\n- Platform: any; observed on `ubuntu-latest` Python 3.12 in CI and locally on macOS\n\n## Possible Solution\n\nThe test checks that kserve and feast can be resolved together. `pip` can answer that without installing anything, using `--dry-run`. Verified both directions:\n\n- no conflict: exits 0, performs full resolution (`Would install … psutil-5.9.8 …`), and leaves the environment untouched — psutil stays at 5.9.0 and kserve is not importable afterwards\n- real conflict: `pip install --dry-run kserve==0.15.2 psutil==5.9.0` exits 1 with `Cannot install kserve==0.15.2 and psutil==5.9.0 because these package versions have conflicting dependencies`\n\nSo the detection is unchanged and the mutation disappears. Happy to open a PR for this.\n\nSeparately, the current assertion looks inverted:\n\n```python\nconflict_occured = \"dependency conflicts\" in err and \"ERROR\" not in err\n```\n\nThat is only true when pip reports conflicts *without* an error, so a run that fails loudly sets it to `False`. The `exit_code == 0` assertion above it is what actually catches failures today.","author":{"url":"https://github.com/larrysingleton007","@type":"Person","name":"larrysingleton007"},"datePublished":"2026-08-12T23:56:12Z","url":"https://github.com/feast-dev/feast/issues/6732"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c0c7546c-f92a-857c-df78-3f34428fa7fd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E258:38CE1B:ED60DE:145093C:6AFE9813 |
| html-safe-nonce | 2b7b629d68975061417215035bea4650a8dc9ba6aa8d85727f969a76d39fb5e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjU4OjM4Q0UxQjpFRDYwREU6MTQ1MDkzQzo2QUZFOTgxMyIsInZpc2l0b3JfaWQiOiIxMDY3NjQ4ODQzNDU1MDQzNjAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 67fa89f9800b0e146527764eaaf53e152a36b2a55f51712f78db1aaf9a0332b4 |
| hovercard-subject-tag | issue:5136360707 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/6732/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2c68ac8e29ed64d3410ef71d13ad533bfdc3ae6b162f957c4f37c6c57607a870/feast-dev/feast/issues/6732 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2c68ac8e29ed64d3410ef71d13ad533bfdc3ae6b162f957c4f37c6c57607a870/feast-dev/feast/issues/6732 |
| og:image:alt | Expected Behavior Running the unit suite leaves the environment it ran in unchanged, and a test's outcome does not depend on what other tests are doing concurrently. Current Behavior sdk/python/tes... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | larrysingleton007 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width