From 835aec0900b79fa6c85ab9369a11c37c9241c7cc Mon Sep 17 00:00:00 2001
From: Kirill Smelkov <kirr@nexedi.com>
Date: Wed, 17 Jul 2019 19:21:41 +0300
Subject: [PATCH] .

---
 wcfs/wcfs_test.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/wcfs/wcfs_test.py b/wcfs/wcfs_test.py
index ea3b6056..29ec8fed 100644
--- a/wcfs/wcfs_test.py
+++ b/wcfs/wcfs_test.py
@@ -1738,6 +1738,7 @@ def test_wcfspy_virtmem():
     wconn = t.wc.connect(at1)
     defer(wconn.close)
 
+    # mmap with 1 block beyond file size
     m1 = wconn.mmap(zf._p_oid, 2, 3)
     defer(m1.unmap)
 
@@ -1751,6 +1752,7 @@ def test_wcfspy_virtmem():
     #assertCache(m1, [0,0,0])
     assert f.pinned == {}
 
+    # initial data reads
     tm1.assertBlk(2, 'c1')
     assert f.pinned == {2:at1}
     tm1.assertBlk(3, 'd1')
@@ -1758,8 +1760,12 @@ def test_wcfspy_virtmem():
     tm1.assertBlk(4, '')
     assert f.pinned == {2:at1}
 
+    # commit with growing file size -> verify data read as the same, #3 pinned
+    # (#4 is not yet pinned because it was not accessed)
     at3 = t.commit(zf, {3:'d3', 4:'e3'})
     assert f.pinned == {2:at1}
+    tm1.assertBlk(2, 'c1')
+    assert f.pinned == {2:at1}
     tm1.assertBlk(3, 'd1')
     assert f.pinned == {2:at1, 3:at1}
     tm1.assertBlk(4, '')
-- 
2.30.9