[8.19] test: mock real I/O in unit tests to stop fail-slow flakes (#4455) - #4468
Merged
Merged
Conversation
) Backports #4455 to `8.19`. ## Summary - Add shared `mock_sync_db_engine` helper and use it in Oracle/MSSQL tests instead of only patching `Engine.connect`. - Mock `aiohttp.ClientSession` in the GraphQL test helper so teardown does not open a real session. - Add regression test asserting GraphQL teardown does not instantiate a real `ClientSession`. ## Backport notes - The 8.19 branch uses monolithic `connectors/sources/{graphql,mssql,oracle}.py` modules, so patch targets differ from `main` (`connectors.sources.graphql.aiohttp.ClientSession`, `connectors.sources.mssql.create_engine`, etc.). - GitLab `get_work_items_group` stubs from the original PR are not applicable on 8.19 (method does not exist there). - The incidental `NOTICE.txt` version bump from `make install` is intentionally excluded. ## Test plan - [x] `make clean install autoformat lint test` - [x] `pytest tests/sources/test_graphql.py tests/sources/test_mssql.py tests/sources/test_oracle.py`
artem-shelkovnikov
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports #4455 to
8.19.Summary
mock_sync_db_enginehelper and use it in Oracle/MSSQL tests instead of only patchingEngine.connect.aiohttp.ClientSessionin the GraphQL test helper so teardown does not open a real session.ClientSession.Backport notes
connectors/sources/{graphql,mssql,oracle}.pymodules, so patch targets differ frommain(connectors.sources.graphql.aiohttp.ClientSession,connectors.sources.mssql.create_engine, etc.).get_work_items_groupstubs from the original PR are not applicable on 8.19 (method does not exist there).NOTICE.txtversion bump frommake installis intentionally excluded.Test plan
make clean install autoformat lint testpytest tests/sources/test_graphql.py tests/sources/test_mssql.py tests/sources/test_oracle.py