Commit 62c3e35f authored by Jim Fulton's avatar Jim Fulton

Merge remote-tracking branch 'origin/master' into no-more-load

Conflicts:
	setup.py
	src/ZODB/tests/synchronizers.txt
parents b64344f8 ee942336
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
Change History Change History
================ ================
4.3.0 (unreleased) 4.3.1 (2016-06-06)
==================
- Fixed: FileStorage loadBefore didn't handle deleted/undone data correctly.
4.3.0 (2016-05-31)
================== ==================
- Drop support for Python 2.6 and 3.2. - Drop support for Python 2.6 and 3.2.
...@@ -29,7 +34,7 @@ ...@@ -29,7 +34,7 @@
- DemoStorage: add support for conflict resolution and fix history() - DemoStorage: add support for conflict resolution and fix history()
https://github.com/zopefoundation/ZODB/pull/58 https://github.com/zopefoundation/ZODB/pull/58
- Fixed: FileStorage loadBefore didn't handle deleted/undone data correctly. - Fixed a test that depended on implementation-specific behavior in tpc_finish
4.2.0 (2015-06-02) 4.2.0 (2015-06-02)
================== ==================
......
...@@ -130,7 +130,7 @@ setup(name="ZODB", ...@@ -130,7 +130,7 @@ setup(name="ZODB",
license = "ZPL 2.1", license = "ZPL 2.1",
platforms = ["any"], platforms = ["any"],
description = doclines[0], description = doclines[0],
classifiers = filter(None, classifiers.split("\n")), classifiers = list(filter(None, classifiers.split("\n"))),
long_description = long_description, long_description = long_description,
test_suite="__main__.alltests", # to support "setup.py test" test_suite="__main__.alltests", # to support "setup.py test"
tests_require = tests_require, tests_require = tests_require,
......
...@@ -17,7 +17,8 @@ Any storage that supports the history() method should be able to pass ...@@ -17,7 +17,8 @@ Any storage that supports the history() method should be able to pass
all these tests. all these tests.
""" """
from time import time import sys
from time import time, sleep
from ZODB.tests.MinPO import MinPO from ZODB.tests.MinPO import MinPO
class HistoryStorage: class HistoryStorage:
...@@ -31,6 +32,9 @@ class HistoryStorage: ...@@ -31,6 +32,9 @@ class HistoryStorage:
self.assertRaises(KeyError,self._storage.history,oid) self.assertRaises(KeyError,self._storage.history,oid)
revids = [None] revids = [None]
for data in data: for data in data:
if sys.platform == 'win32':
# time.time() has a precision of 1ms on Windows.
sleep(0.001)
revids.append(self._dostore(oid, revids[-1], MinPO(data))) revids.append(self._dostore(oid, revids[-1], MinPO(data)))
revids.reverse() revids.reverse()
del revids[-1] del revids[-1]
......
...@@ -15,6 +15,7 @@ import doctest ...@@ -15,6 +15,7 @@ import doctest
import os import os
if os.environ.get('USE_ZOPE_TESTING_DOCTEST'): if os.environ.get('USE_ZOPE_TESTING_DOCTEST'):
from zope.testing import doctest from zope.testing import doctest
import sys
import unittest import unittest
import transaction import transaction
import ZODB.FileStorage import ZODB.FileStorage
...@@ -303,6 +304,15 @@ class FileStorageTests( ...@@ -303,6 +304,15 @@ class FileStorageTests(
# is based on what was cached during the first load. # is based on what was cached during the first load.
self.assertEqual(storage.load(z64)[0], b'foo' if fail else b'bar') self.assertEqual(storage.load(z64)[0], b'foo' if fail else b'bar')
# We want to be sure that the above test detects any regression
# in the code it checks, because any bug here is like a time bomb: not
# obvious, hard to reproduce, with possible data corruption.
# It's even more important that FilePool.flush() is quite aggressive and
# we'd like to optimize it when Python gets an API to flush read buffers.
# Therefore, 'checkFlushAfterTruncate' is tested in turn by another unit
# test.
# On Windows, flushing explicitely is not (always?) necessary.
if sys.platform != 'win32':
def checkFlushNeededAfterTruncate(self): def checkFlushNeededAfterTruncate(self):
self._storage._files.flush = lambda: None self._storage._files.flush = lambda: None
self.checkFlushAfterTruncate(True) self.checkFlushAfterTruncate(True)
...@@ -390,7 +400,7 @@ class AnalyzeDotPyTest(StorageTestBase.StorageTestBase): ...@@ -390,7 +400,7 @@ class AnalyzeDotPyTest(StorageTestBase.StorageTestBase):
self._storage = ZODB.FileStorage.FileStorage("Source.fs", create=True) self._storage = ZODB.FileStorage.FileStorage("Source.fs", create=True)
def checkanalyze(self): def checkanalyze(self):
import types, sys import types
from BTrees.OOBTree import OOBTree from BTrees.OOBTree import OOBTree
from ZODB.scripts import analyze from ZODB.scripts import analyze
......
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