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:
Daniele Varrazzo 2010-12-04 23:21:16 +00:00
parent 13c2f5a78b
commit cf243ccf37

View File

@ -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")