Commit 2be847c4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f118617b
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
from __future__ import print_function, absolute_import from __future__ import print_function, absolute_import
from golang import func, defer from golang import func, defer
from functools import partial
# Before pytest exits, teardown WCFS(s) that we automatically spawned during # Before pytest exits, teardown WCFS(s) that we automatically spawned during
# test runs in bigfile/bigarray/... # test runs in bigfile/bigarray/...
...@@ -30,16 +31,20 @@ from golang import func, defer ...@@ -30,16 +31,20 @@ from golang import func, defer
@func @func
def pytest_unconfigure(config): def pytest_unconfigure(config):
from wendelin import wcfs from wendelin import wcfs
from wendelin.wcfs.wcfs_test import tWCFS
print("\n\nspawned WCFS:") print("\n\nspawned WCFS:")
print(wcfs._wcstarted) print(wcfs._wcstarted)
print("closing...")
for wc in wcfs._wcstarted: for wc in wcfs._wcstarted:
if wc._proc.poll() is not None: if wc._proc.poll() is not None:
continue # this wcfs server already exited continue # this wcfs server already exited
twc = tWCFS(wc=wc)
# FIXME currently has to kill wcfs.go, because swapned pinner threads are running # FIXME currently has to kill wcfs.go, because swapned pinner threads are running
# -> stop pinner first # -> stop pinner first
# NOTE: defer instead of direct call - to call all wc.close if there was multiple wc spawned # NOTE: defer instead of direct call - to call all wc.close if there was multiple wc spawned
defer(twc.close) defer(partial(_wcclose, wc))
def _wcclose(wc):
from wendelin.wcfs.wcfs_test import tWCFS
print("(unmount/stop wcfs pid%d @ %s)" % (wc._proc.pid, wc.mountpoint))
twc = tWCFS(wc=wc)
twc.close()
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