Commit 066d7203 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8bf8f23b
......@@ -22,6 +22,7 @@ from __future__ import print_function, absolute_import
from golang import func, defer
from functools import partial
import gc
# Before pytest exits, teardown WCFS(s) that we automatically spawned during
# test runs in bigfile/bigarray/...
......@@ -30,21 +31,23 @@ from functools import partial
# by stdout to nxdtest input - which makes nxdtest to wait for them to exit.
@func
def pytest_unconfigure(config):
# force collection of ZODB Connection(s) that were sitting in DB.pool(s)
# (DB should be closed)
gc.collect()
from wendelin import wcfs
print("\n\nspawned WCFS:")
print(wcfs._wcstarted)
for wc in wcfs._wcstarted:
if wc._proc.poll() is not None:
continue # this wcfs server already exited
# FIXME currently has to kill wcfs.go, because swapned pinner threads are running
# -> 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, and proceeding till the end even if any
# particular call raises exception.
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))
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