sadpandajoe opened a new pull request, #44853: URL: https://github.com/apache/superset/pull/44853
### SUMMARY The `Python-Integration` workflow's `test-postgres (next)` leg (Python 3.13) aborts on `master` with a `PluggyTeardownRaisedWarning` and an `INTERNALERROR`, losing the whole job's results rather than failing a test: ``` INTERNALERROR> pytest_cov/engine.py:52 in ensure_topdir_wrapper INTERNALERROR> pyfakefs/fake_os.py:421 in chdir INTERNALERROR> KeyError: 'home' INTERNALERROR> FileNotFoundError: [Errno 2] No such file or directory in the fake filesystem: '/home/runner/work/superset/superset' ``` `pyfakefs` was an unpinned direct dependency of the `development` extra, so `requirements/development.txt` had it locked at **5.3.5** — a release that predates pyfakefs's own Python 3.13 support. Under 3.13, 5.3.5 leaves `os.chdir` patched to the fake filesystem after the function-scoped `fs` fixture is undone, so when pytest-cov's `pytest_runtestloop` hookwrapper teardown chdirs back to the rootdir it resolves the real path against the fake filesystem and raises, aborting the session. This became visible when #44767 moved the `next` leg off 3.12. The abort lands right after `tests/integration_tests/celery_tests.py`, as pytest reaches `tests/integration_tests/cli_tests.py` — the only test file in the repo that uses pyfakefs's `fs` fixture. **Fix:** floor the dependency at `pyfakefs>=5.7.4` in `pyproject.toml` and regenerate the lock (resolves to `pyfakefs==6.2.0`). Why 5.7.4 and not lower: 5.6.0 added preliminary 3.13 support and is the first release in which the chdir crash no longer reproduces, and 5.7.0 made 3.13 support official — but 5.7.4 additionally fixes module/session-scoped fixtures under 3.13 ([pyfakefs #1101](https://github.com/pytest-dev/pyfakefs/issues/1101)), and the `fs` tests in `cli_tests.py` run alongside session- and module-scoped fixtures (`load_birth_names_data`, `load_birth_names_dashboard_with_slices`). 5.7.4 is the lowest floor that covers both 3.13 bugs this test file can hit. pyfakefs 6.x drops Python < 3.10, which is compatible with this project's `requires-python = ">=3.11"`, and adds no new runtime dependencies — hence the single-line lock change. `cli_tests.py` only calls `fs.create_dir` and `fs.create_file`, so 6.0's `shuffle_listdir_results` default flip does not affect it. `requirements/base.txt` is unaffected: pyfakefs is dev-only. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — CI dependency floor. ### TESTING INSTRUCTIONS Reproduced in isolation with CI's pinned versions (`pytest==7.4.4`, `pytest-cov==6.0.0`, `coverage==7.6.8`) using two files — one plain test and one using the `fs` fixture — run under `pytest --cov=.`: | Python | pyfakefs | Result | | --- | --- | --- | | 3.13.15 | 5.3.5 (previous lock) | `INTERNALERROR`, identical signature to CI | | 3.13.15 | 5.4.1, 5.5.0 | `INTERNALERROR` | | 3.13.15 | 5.6.0 → 6.2.0 | pass | | 3.11.16 / 3.12.14 | 6.2.0 | pass | `uv pip compile` of `pyfakefs>=5.7.4` under Python 3.11 (the version `scripts/uv-pip-compile.sh` uses) resolves to exactly `pyfakefs==6.2.0`. In CI, the signal is `test-postgres (next)` completing instead of aborting. Note that this leg runs only on pushes to `master`, not on pull requests (`superset-python-integrationtest.yml` restricts the matrix to `["current"]` for `pull_request`), so this PR's own checks will not exercise it. ### ADDITIONAL INFORMATION - [x] Has associated issue: Fixes #44852 - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
