diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2008-04-05 04:26:31 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-04-05 04:26:31 (GMT) |
commit | 8510195ceb394efc3379dce32f2fe064daa823a4 (patch) | |
tree | a1e8bc0e1e488d095396a472b2967d09968d8376 | |
parent | b2ff8a7b0d2dbe88f934911d916d3dbd990a549a (diff) | |
download | cpython-8510195ceb394efc3379dce32f2fe064daa823a4.zip cpython-8510195ceb394efc3379dce32f2fe064daa823a4.tar.gz cpython-8510195ceb394efc3379dce32f2fe064daa823a4.tar.bz2 |
Prevent test_sqlite from hanging on older versions of sqlite.
The problem is that when trying to do the second insert, sqlite seems to sleep
for a very long time. Here is the output from strace:
read(6, "SQLite format 3\0\4\0\1\1\0@ \0\0\0\1\0\0\0\0"..., 1024) = 1024
nanosleep({4294, 966296000}, <unfinished ...>
I don't know which version this was fixed in, but 3.2.1 definitely fails.
-rw-r--r-- | Lib/sqlite3/test/transactions.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/transactions.py b/Lib/sqlite3/test/transactions.py index d4f7d62..9cc6e10 100644 --- a/Lib/sqlite3/test/transactions.py +++ b/Lib/sqlite3/test/transactions.py @@ -113,6 +113,10 @@ class TransactionTests(unittest.TestCase): self.failUnlessEqual(len(res), 1) def CheckRaiseTimeout(self): + if sqlite.sqlite_version_info < (3, 2, 2): + # This will fail (hang) on earlier versions of sqlite. + # Determine exact version it was fixed. 3.2.1 hangs. + return self.cur1.execute("create table test(i)") self.cur1.execute("insert into test(i) values (5)") try: @@ -128,6 +132,10 @@ class TransactionTests(unittest.TestCase): This tests the improved concurrency with pysqlite 2.3.4. You needed to roll back con2 before you could commit con1. """ + if sqlite.sqlite_version_info < (3, 2, 2): + # This will fail (hang) on earlier versions of sqlite. + # Determine exact version it was fixed. 3.2.1 hangs. + return self.cur1.execute("create table test(i)") self.cur1.execute("insert into test(i) values (5)") try: |