Commit d5f69194 authored by Tres Seaver's avatar Tres Seaver

Normalize out pickle sizes / offsets.

parent 1b048698
...@@ -60,28 +60,28 @@ seems best and set the next record to that: ...@@ -60,28 +60,28 @@ seems best and set the next record to that:
>>> it.close() >>> it.close()
>>> it = ZODB.FileStorage.FileIterator('data.fs', tids[1]) >>> it = ZODB.FileStorage.FileIterator('data.fs', tids[1])
Scan forward data.fs:4 looking for '\x03z\xbd\xd8\xd06\x9c\xcc' Scan forward data.fs:<OFFSET> looking for '\x03z\xbd\xd8\xd06\x9c\xcc'
>>> it.next().tid == tids[1] >>> it.next().tid == tids[1]
True True
>>> it.close() >>> it.close()
>>> it = ZODB.FileStorage.FileIterator('data.fs', tids[30]) >>> it = ZODB.FileStorage.FileIterator('data.fs', tids[30])
Scan forward data.fs:4 looking for '\x03z\xbd\xd8\xdc\x96.\xcc' Scan forward data.fs:<OFFSET> looking for '\x03z\xbd\xd8\xdc\x96.\xcc'
>>> it.next().tid == tids[30] >>> it.next().tid == tids[30]
True True
>>> it.close() >>> it.close()
>>> it = ZODB.FileStorage.FileIterator('data.fs', tids[70]) >>> it = ZODB.FileStorage.FileIterator('data.fs', tids[70])
Scan backward data.fs:117080 looking for '\x03z\xbd\xd8\xed\xa7>\xcc' Scan backward data.fs:<OFFSET> looking for '\x03z\xbd\xd8\xed\xa7>\xcc'
>>> it.next().tid == tids[70] >>> it.next().tid == tids[70]
True True
>>> it.close() >>> it.close()
>>> it = ZODB.FileStorage.FileIterator('data.fs', tids[-2]) >>> it = ZODB.FileStorage.FileIterator('data.fs', tids[-2])
Scan backward data.fs:117080 looking for '\x03z\xbd\xd8\xfa\x06\xd0\xcc' Scan backward data.fs:<OFFSET> looking for '\x03z\xbd\xd8\xfa\x06\xd0\xcc'
>>> it.next().tid == tids[-2] >>> it.next().tid == tids[-2]
True True
...@@ -115,14 +115,14 @@ starting point, or just pick up where another iterator left off: ...@@ -115,14 +115,14 @@ starting point, or just pick up where another iterator left off:
>>> it.close() >>> it.close()
>>> it = ZODB.FileStorage.FileIterator('data.fs', tids[50], pos=poss[50]) >>> it = ZODB.FileStorage.FileIterator('data.fs', tids[50], pos=poss[50])
Scan backward data.fs:35936 looking for '\x03z\xbd\xd8\xe5\x1e\xb6\xcc' Scan backward data.fs:<OFFSET> looking for '\x03z\xbd\xd8\xe5\x1e\xb6\xcc'
>>> it.next().tid == tids[50] >>> it.next().tid == tids[50]
True True
>>> it.close() >>> it.close()
>>> it = ZODB.FileStorage.FileIterator('data.fs', tids[49], pos=poss[50]) >>> it = ZODB.FileStorage.FileIterator('data.fs', tids[49], pos=poss[50])
Scan backward data.fs:35936 looking for '\x03z\xbd\xd8\xe4\xb1|\xcc' Scan backward data.fs:<OFFSET> looking for '\x03z\xbd\xd8\xe4\xb1|\xcc'
>>> it.next().tid == tids[49] >>> it.next().tid == tids[49]
True True
......
...@@ -28,14 +28,8 @@ checker = renormalizing.RENormalizing([ ...@@ -28,14 +28,8 @@ checker = renormalizing.RENormalizing([
# Python 3 adds module name to exceptions. # Python 3 adds module name to exceptions.
(re.compile("ZODB.POSException.POSKeyError"), r"POSKeyError"), (re.compile("ZODB.POSException.POSKeyError"), r"POSKeyError"),
(re.compile("ZODB.FileStorage.FileStorage.FileStorageQuotaError"), (re.compile("ZODB.FileStorage.FileStorage.FileStorageQuotaError"),
r"FileStorageQuotaError"), "FileStorageQuotaError"),
# Python 3 produces larger pickles, even when we use zodbpickle :( (re.compile('data.fs:[0-9]+'), 'data.fs:<OFFSET>'),
# this changes all the offsets in iterator.test
(re.compile('data.fs:207766'), 'data.fs:117080'),
(re.compile('data.fs:57991'), 'data.fs:35936'),
# even with Pickler(bytes_as_strings=True) some of our pickles are larger
(re.compile('data.fs:117679'), 'data.fs:117080'),
(re.compile('data.fs:36241'), 'data.fs:35936'),
]) ])
def pack_keep_old(): def pack_keep_old():
...@@ -195,11 +189,14 @@ cleanup ...@@ -195,11 +189,14 @@ cleanup
def test_suite(): def test_suite():
return unittest.TestSuite(( return unittest.TestSuite((
doctest.DocFileSuite( doctest.DocFileSuite(
'zconfig.txt', 'iterator.test', 'zconfig.txt',
setUp=ZODB.tests.util.setUp, tearDown=ZODB.tests.util.tearDown, 'iterator.test',
setUp=ZODB.tests.util.setUp,
tearDown=ZODB.tests.util.tearDown,
checker=checker), checker=checker),
doctest.DocTestSuite( doctest.DocTestSuite(
setUp=ZODB.tests.util.setUp, tearDown=ZODB.tests.util.tearDown, setUp=ZODB.tests.util.setUp,
tearDown=ZODB.tests.util.tearDown,
checker=checker), checker=checker),
)) ))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment