Skip to content

Fix flaky python test#3507

Open
GumpacG wants to merge 1 commit into
apache:masterfrom
GumpacG:python-fix
Open

Fix flaky python test#3507
GumpacG wants to merge 1 commit into
apache:masterfrom
GumpacG:python-fix

Conversation

@GumpacG

@GumpacG GumpacG commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fix flaky gremlin-python test: test_client_side_timeout_set_for_aiohttp

The test asserted str(err) == "" on the caught timeout, assuming a bare asyncio.TimeoutError (empty message). But the driver arms two read-timeout timers at the same value the driver's asyncio.timeout wrapper and aiohttp's sock_read timer and whichever fires first is a race. When aiohttp's wins, the error is a SocketTimeoutError ("Timeout on reading data from socket"), so the message assertion fails intermittently (seen on python-3.11 and python-3.12 across runs).

Fix: drop the brittle message-equality assertion. The test still catches TimeoutError (both variants subclass it), still fails if no timeout occurs, and still verifies the client recovers afterward, it just no longer pins a library-internal message string.

@codecov-commenter

codecov-commenter commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.23%. Comparing base (a28cd1f) to head (4a67bce).
⚠️ Report is 187 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3507      +/-   ##
============================================
- Coverage     76.35%   76.23%   -0.13%     
- Complexity    13424    13934     +510     
============================================
  Files          1012     1030      +18     
  Lines         60341    62874    +2533     
  Branches       7075     7368     +293     
============================================
+ Hits          46076    47934    +1858     
- Misses        11548    11961     +413     
- Partials       2717     2979     +262     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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