Commit 2437111
Do not leak psycopg2 connections during testing (#628)
According to psycopg2 documentation connections are not closed on context exit.
This is in contrast with connection cursors that actually do so.
It is not an inherent problem in itself, however, calls to get_state() in a
loop, such as from wait_until_*, can overflow the connection limits and cause
the test suite to fail. This is particularly noticable when the system is slow
to respond, for example if it is run under valgrind.
This might address other objerved flakyness in the tests due to connection
exhaustion with messages as:
"psycopg2.OperationalError: FATAL: sorry, too many clients already"
Co-authored-by: Georgios Kokolatos <gkokolatos@pm.com>1 parent cc9be24 commit 2437111
1 file changed
Lines changed: 15 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
| |||
0 commit comments