Skip to content

Commit 8ec2a15

Browse files
committed
test: Fix FATAL: sorry, too many clients already
When disposing the SQLAlchemy engine object after use, the error goes away.
1 parent c0d4a89 commit 8ec2a15

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

target_postgres/tests/test_target_postgres.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def verify_data(
132132
sqlalchemy.text(f"SELECT COUNT(*) FROM {full_table_name}")
133133
)
134134
assert result.first()[0] == number_of_rows
135+
engine.dispose()
135136

136137

137138
def verify_schema(
@@ -169,6 +170,7 @@ def verify_schema(
169170
f"Column '{column.name}' (with type '{column.type}') "
170171
f"does not match expected type: {column_type_expected}"
171172
)
173+
engine.dispose()
172174

173175

174176
def test_sqlalchemy_url_config(postgres_config_no_ssl):

0 commit comments

Comments
 (0)