Skip to content

[KYUUBI #7360] Fix flaky PyHive test connection - #7595

Open
NikhilUjjwal7 wants to merge 2 commits into
apache:masterfrom
NikhilUjjwal7:fix-pyhive-test-description-flaky
Open

[KYUUBI #7360] Fix flaky PyHive test connection#7595
NikhilUjjwal7 wants to merge 2 commits into
apache:masterfrom
NikhilUjjwal7:fix-pyhive-test-description-flaky

Conversation

@NikhilUjjwal7

Copy link
Copy Markdown

Why are the changes needed?

Fixes #7360.

python/pyhive/tests/test_hive.py::TestHive::test_description can fail intermittently while opening the Hive connection with TTransportException: TSocket read 0 bytes.

This patch makes the test connection helper retry transient TTransportExceptions before failing, which makes the PyHive integration tests more tolerant of short HiveServer2 startup or connection timing issues.

How was this patch tested?

Added a unit test that simulates a transient TTransportException from hive.connect and verifies that TestHive.connect() retries and succeeds on the next attempt.

Tested with:

python -m pytest python/pyhive/tests/test_hive.py::TestHive::test_connect_retries_transient_transport_failure -q

Result:
1 passed in 1.07s

@NikhilUjjwal7

Copy link
Copy Markdown
Author

The triage workflow failure appears to be unrelated to this PR. It fails while parsing .github/labeler.yml in actions/labeler@v7, while this PR only changes python/pyhive/tests/test_hive.py.

Comment thread python/pyhive/tests/test_hive.py Outdated
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.

[Bug] test_hive.py::TestHive::test_description is flaky

3 participants