The HTTP connection pool was not being reused in integration tests. As a result a typical single run would create and tear down almost 400 connections.
When a connection error occurred retry logic would retry the HTTP request which would in most cases fail the test since Synapse would conflict with the data it already has.
These errors kept showing up
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
ConnectionResetError: [Errno 104] Connection reset by peer
Builds were taking place during both the PR creation and commits. This means after a PR is created any new commits caused 2 builds to be ran.
Solution:
Upgrading to pytest-v7, and a newer pytest-asyncio
Problem:
Solution:
Testing: