Commit 0f93dd0c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 44a59d27
...@@ -126,6 +126,14 @@ class _Mapping(object): ...@@ -126,6 +126,14 @@ class _Mapping(object):
def connect(wc, at): # -> Conn def connect(wc, at): # -> Conn
return Conn(wc, at) return Conn(wc, at)
# close releases resources associated with wconn.
# XXX what happens to file mmappings?
@func(Conn)
def close(wconn):
# XXX stop/join pinner
wconn._wlink.close()
# _pinner receives pin messages from wcfs and adjusts wconn mappings. # _pinner receives pin messages from wcfs and adjusts wconn mappings.
@func(Conn) @func(Conn)
def _pinner(wconn, ctx): def _pinner(wconn, ctx):
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
# See https://www.nexedi.com/licensing for rationale and options. # See https://www.nexedi.com/licensing for rationale and options.
"""wcfs_test tests wcfs filesystem from outside as python client process """wcfs_test tests wcfs filesystem from outside as python client process
It also unit-tests wcfs.py virtmem-level infrastructure. It also unit-tests wcfs.py virtmem-level integration.
At functional level, the whole wendelin.core test suite is used to verify At functional level, the whole wendelin.core test suite is used to verify
wcfs.py/wcfs.go while running tox tests in wcfs mode. wcfs.py/wcfs.go while running tox tests in wcfs mode.
...@@ -1685,8 +1685,9 @@ def test_wcfs_watch_2files(): ...@@ -1685,8 +1685,9 @@ def test_wcfs_watch_2files():
# ---- wcfs.py + virtmem integration ---- # ---- wcfs.py + virtmem integration ----
# XXX name, text ... # XXX text ...
def test_XXX(): @func
def test_wcfspy_virtmem():
t = tDB(); zf = t.zfile t = tDB(); zf = t.zfile
defer(t.close) defer(t.close)
...@@ -1694,6 +1695,7 @@ def test_XXX(): ...@@ -1694,6 +1695,7 @@ def test_XXX():
at2 = t.commit(zf, {2:'c2'}) at2 = t.commit(zf, {2:'c2'})
wconn = t.wc.connect(at1) wconn = t.wc.connect(at1)
defer(wconn.close)
# ---- misc --- # ---- misc ---
......
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