Commit 197c35ea authored by Kirill Smelkov's avatar Kirill Smelkov

X wc1: Split out demo for failing cache invalidation into xfail'ing test

See 69c94fbc and 48eb692f for description of the problem.
parent 10ca939f
......@@ -36,6 +36,7 @@ import weakref
import gc
from pytest import raises
import pytest; xfail = pytest.mark.xfail
from six.moves import range as xrange
......@@ -555,7 +556,7 @@ def test_bigfile_filezodb_vs_conn_migration():
# ZBlk should properly handle 'invalidate' messages from DB
# ( NOTE this test is almost dupped at test_zbigarray_vs_cache_invalidation() )
@func
def test_bigfile_filezodb_vs_cache_invalidation():
def _test_bigfile_filezodb_vs_cache_invalidation(_drop_cache):
root = dbopen()
conn = root._p_jar
db = conn.db()
......@@ -609,15 +610,14 @@ def test_bigfile_filezodb_vs_cache_invalidation():
ram_reclaim_all()
assert Blk(vma2, 0)[0] == 1
# """
# FIXME: this simulates ZODB Connection cache pressure and currently
# removes ZBlk corresponding to blk #0 from conn2 cache.
# In turn this leads to conn2 missing that block invalidation on follow-up
# transaction boundary.
#
# See FIXME notes on ZBlkBase._p_invalidate() for detailed description.
conn2._cache.minimize()
# """
#conn2._cache.minimize()
_drop_cache(conn2) # XXX change to just conn2._cache.minimize after issue is fixed
tm2.commit() # transaction boundary for t2
......@@ -626,6 +626,12 @@ def test_bigfile_filezodb_vs_cache_invalidation():
del conn2, root2
def test_bigfile_filezodb_vs_cache_invalidation():
_test_bigfile_filezodb_vs_cache_invalidation(_drop_cache=lambda conn: None)
@xfail
def test_bigfile_filezodb_vs_cache_invalidation_with_cache_pressure():
_test_bigfile_filezodb_vs_cache_invalidation(_drop_cache=lambda conn: conn._cache.minimize())
# verify that conflicts on ZBlk are handled properly
# ( NOTE this test is almost dupped at test_zbigarray_vs_conflicts() )
......
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