Skip to content

Commit

Permalink
test: Fix FATAL: sorry, too many clients already
Browse files Browse the repository at this point in the history
Within `BasePostgresSDKTests`, new database connections via SQLAlchemy
haven't been closed, and started filling up the connection pool,
eventually saturating it.
  • Loading branch information
amotl committed Dec 19, 2023
1 parent 8ec2a15 commit 223a64c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion target_postgres/tests/test_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class BasePostgresSDKTests:
@pytest.fixture()
def connection(self, runner):
engine = create_engine(runner)
return engine.connect()
with engine.connect() as connection:
yield connection


SDKTests = get_target_test_class(
Expand Down

0 comments on commit 223a64c

Please sign in to comment.