Skip to content

bugfix/fix-flaky-aiohttp-unit-tests#200

Merged
chopkinsmade merged 1 commit into
mainfrom
bugfix/fix-flaky-aiohttp-unit-tests
Apr 16, 2026
Merged

bugfix/fix-flaky-aiohttp-unit-tests#200
chopkinsmade merged 1 commit into
mainfrom
bugfix/fix-flaky-aiohttp-unit-tests

Conversation

@chopkinsmade
Copy link
Copy Markdown
Contributor

@chopkinsmade chopkinsmade commented Apr 13, 2026

Description

  • Amend the aio_client_factory fixture to use the asyncio loop created by the unit test inside the aiohttp test client. When this code is missing, the aiohttp code might use a different task loop than the test which causes flaky tests.
  • Skip the broken test for now while a fix is investigated. Even after setting the aiohttp test client to use the same task loop, an internal function that closes the connection is using a different task loop causing errors
  • Use the config setting asyncio_mode = "auto" to auto run async tests without needing to use a pytest.mark statement

Contributors

Let's acknowledge the people who contributed to the work.

Type of change

  • Refactoring (made code better without changing its behaviour)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How this has been tested

Please describe the tests that you ran to verify your changes.

If they are not automated tests please explain why and provide screenshots and/or instructions so they can reproduced.

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Reviewer Checklist

  • I have reviewed the PR and ensured no secret values are present

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 2026

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

Scanned Files

None

@chopkinsmade chopkinsmade force-pushed the bugfix/fix-flaky-aiohttp-unit-tests branch 7 times, most recently from 6115092 to c93e359 Compare April 13, 2026 15:52
@chopkinsmade chopkinsmade force-pushed the bugfix/fix-flaky-aiohttp-unit-tests branch from c93e359 to 54bbaba Compare April 13, 2026 15:53
@chopkinsmade chopkinsmade marked this pull request as ready for review April 16, 2026 09:46
@chopkinsmade chopkinsmade requested a review from a team as a code owner April 16, 2026 09:46
@chopkinsmade chopkinsmade merged commit 8c85ccf into main Apr 16, 2026
17 checks passed
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