From 78c54e48a3d14a8e484089adeb143627f1aadea1 Mon Sep 17 00:00:00 2001
From: Kirill Smelkov <kirr@nexedi.com>
Date: Sun, 23 Jun 2019 20:24:10 +0300
Subject: [PATCH] .

---
 wcfs/wcfs_test.py | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/wcfs/wcfs_test.py b/wcfs/wcfs_test.py
index 1894a39..628313e 100644
--- a/wcfs/wcfs_test.py
+++ b/wcfs/wcfs_test.py
@@ -849,7 +849,7 @@ class tSrvReq:
 
 # watch sets up or adjusts a watch for file@at.
 #
-# During setup it verifies that wcfs sends correct initial pins.
+# During setup it verifies that wcfs sends correct initial/update pins.
 #
 # pinok: {} blk -> rev
 # pinok can be omitted - in that case it is computed automatically.
@@ -857,11 +857,11 @@ class tSrvReq:
 # The automatic computation of pinok is verified against explicitly provided
 # pinok when it is present.
 #
-# Criteria for when blk must be pinned:
+# Criteria for when blk must be pinned as of @at view:
 #
-#   blk ∈ pin(at)   <=>   ∃ r = rev(blk):
-#                           1) at < r                   ; block was changed after at
-#                           2) r  ≤ headOfAccess(blk)   ; block revision changed after at was accessed
+#   blk ∈ pinned(at)   <=>   ∃ r = rev(blk):
+#                               1) at < r                   ; block was changed after at
+#                               2) r  ≤ headOfAccess(blk)   ; block revision changed after at was accessed
 @func(tWatchLink)
 def watch(twlink, zf, at, pinok=None): # -> tWatch
     t = twlink.tdb
@@ -940,7 +940,10 @@ def watch(twlink, zf, at, pinok=None): # -> tWatch
     twlink._watch(zf, at, pinok, "ok")
 
     w.at = at
+
+    # `watch ... -> at_i -> at_j`  must be the same as  `watch ø -> at_j`
     assert w.pinned == t._needPinAt(zf, at) # XXX & headOfBlkAccess
+
     return w
 
 
@@ -1327,18 +1330,10 @@ def test_wcfs():
             print('\n--------')
             print(' -> '.join([t.hat(_) for _ in revv]))
             wl = t.openwatch()
-            w = wl.watch(zf, revv[0])
+            wl.watch(zf, revv[0])
             wl.watch(zf, revv[0])    # verify at_i -> at_i
             for at in revv[1:]:
                 wl.watch(zf, at)
-
-                # at_i -> at_j -> at_k  must be the same as ø -> at_k
-                wl_ = t.openwatch()
-                w_ = wl_.watch(zf, at)
-                assert w.at == w_.at
-                assert w.pinned == w_.pinned
-                wl_.close()
-
             wl.close()
 #   """
 
-- 
2.30.9