mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 19:03:43 +03:00
Shorter "never ending query" to test query canceling.
If the cancel signal misses the race, this query will stay in the backend until the sleep expires.
This commit is contained in:
parent
13c2f5a78b
commit
cf243ccf37
|
@ -35,7 +35,7 @@ class CancelTests(unittest.TestCase):
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
try:
|
try:
|
||||||
self.assertRaises(psycopg2.extensions.QueryCanceledError,
|
self.assertRaises(psycopg2.extensions.QueryCanceledError,
|
||||||
cur.execute, "select pg_sleep(10000)")
|
cur.execute, "select pg_sleep(60)")
|
||||||
# make sure the connection still works
|
# make sure the connection still works
|
||||||
conn.rollback()
|
conn.rollback()
|
||||||
cur.execute("select 1")
|
cur.execute("select 1")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user