[pypy-dev] Sqlite tests broken for pypyp 3.6
jeandaniel.browne at gmail.com
Mon Apr 2 16:49:29 EDT 2018
Here is Arianna and I's understanding of the problem we see on the buildbot
1. The tests are failing because CPython's sqlite3 module changed between
3.5 and 3.6 and Pypy's sqlite3 module needs to be modified to reflect that.
2. CPython's s sqlite3 now "no longer implicitly commits an open
transaction"  and we ported that commit in Pypy
3. Now, the "CheckTypeMapUsage" test  started to break, but that is
because that test relies on CPython's deterministic garbage collector:
4. The test creates a cursor that does a SELECT on a table. The SELECT cursor
does not go through all the data, before a DROP is executed on the table.
The sqlite3 library keeps track of the unfinalized SELECT and usually
rejects such a DROP with a 'database locked' error message. This is to make
sure the SELECT does silently get an incomplete view.
5. In CPython, the test does pass, because the SELECT cursor is not
assigned to a variable, and is deleted right away by the GC, which
finalizes the cursor, which unlocks the database.
6. We checked that, when the test is modified so that the cursor gets
assigned to a variable, then CPython's test receives the 'database locked'
error when the DROP is attempted. This confirms the point above.
7. In Pypy, the test used to pass in 3.5 because of a workaround
implemented in Pypy's sqlite3 module  that relies on "open transactions
being automatically committed", behavior which got removed in .
Our understanding is that the workaround breaks a guard from Sqlite, also
it introduces a significant skew between CPython and Pypy.
Here are the steps we suggest:
a. fix the CheckTypeMapUsage test that relies on the GC behavior in CPython
b. update the tests in Pypy
c. remove the workaround in Pypy
d. port the commit in  from CPython to Pypy.
What do you think about these steps?
Thanks a lot for your warm welcome at the Pypy Sprint, very enjoyable :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pypy-dev