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

.

parent 8bf8f23b
...@@ -22,6 +22,7 @@ from __future__ import print_function, absolute_import ...@@ -22,6 +22,7 @@ from __future__ import print_function, absolute_import
from golang import func, defer from golang import func, defer
from functools import partial from functools import partial
import gc
# 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,21 +31,23 @@ from functools import partial ...@@ -30,21 +31,23 @@ from functools import partial
# by stdout to nxdtest input - which makes nxdtest to wait for them to exit. # by stdout to nxdtest input - which makes nxdtest to wait for them to exit.
@func @func
def pytest_unconfigure(config): 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 from wendelin import wcfs
print("\n\nspawned WCFS:")
print(wcfs._wcstarted)
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
# FIXME currently has to kill wcfs.go, because swapned pinner threads are running # NOTE: defer instead of direct call - to call all wc.close if there
# -> stop pinner first # was multiple wc spawned, and proceeding till the end even if any
# NOTE: defer instead of direct call - to call all wc.close if there was multiple wc spawned # particular call raises exception.
defer(partial(_wcclose, wc)) defer(partial(_wcclose, wc))
def _wcclose(wc): def _wcclose(wc):
from wendelin.wcfs.wcfs_test import tWCFS 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 = tWCFS(wc=wc)
twc.close() 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