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 e66085c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion target_postgres/tests/test_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ class BasePostgresSDKTests:
@pytest.fixture()
def connection(self, runner):
engine = create_engine(runner)
return engine.connect()
with engine.connect() as connection:
yield connection
engine.dispose()


SDKTests = get_target_test_class(
Expand Down

0 comments on commit e66085c

Please sign in to comment.