Skip to content

Commit ff2c766

Browse files
committed
allow 2 uncleared connections at most
tests show that if the code is really broken, we have 5 or more connections lingering here, so for less than two (it's usually one) just clean it out and consider it as GC noise. To test this better we also open up the windows/mac archs that were disabled for greenlet Fixes: #13102 Change-Id: Iccf419e7f345bcae4a388d222ab69fc792a3c1ca
1 parent 290378a commit ff2c766

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/run-test.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ jobs:
5858
pytest-args: "-k 'not test_autocommit_on and not test_turn_autocommit_off_via_default_iso_level and not test_autocommit_isolation_level'"
5959

6060
exclude:
61-
# cext-greenlet only runs on ubuntu x64 and arm64
62-
- build-type: "cext-greenlet"
63-
os: "windows-latest"
64-
- build-type: "cext-greenlet"
65-
os: "windows-11-arm"
66-
- build-type: "cext-greenlet"
67-
os: "macos-latest"
6861

6962
# the threaded pythons are not stable under greenlet. Even
7063
# though we can run individual tests, when you run the whole suite

lib/sqlalchemy/testing/engines.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,14 @@ def stop_test_class_outside_fixtures(self):
162162
if pool.base._strong_ref_connection_records:
163163
ln = len(pool.base._strong_ref_connection_records)
164164
pool.base._strong_ref_connection_records.clear()
165-
assert (
166-
False
167-
), "%d connection recs not cleared after test suite" % (ln)
165+
166+
if ln > 2:
167+
# allow two connections to linger, as on loaded down
168+
# CI hardware there seem to be occasional GC lapses that
169+
# are not easily preventable
170+
assert (
171+
False
172+
), "%d connection recs not cleared after test suite" % (ln)
168173
if config.options and config.options.low_connections:
169174
# for suites running with --low-connections, dispose the "global"
170175
# engines to disconnect everything before making a testing engine

0 commit comments

Comments
 (0)