Fix cores volumes dropping before close

* Add references to Cores in Cache, ctx holds caches, caches hold cores,
  everything gets cleaned up nicely

* GC in Python seems to be a bit lazy, if we want to run CI on
  low-memory machines we need to make sure it does run in between tests
  'cause we don't want no huge Volumes hanging around for long

Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
Jan Musial
2019-04-18 14:03:31 +02:00
parent f66579ac8b
commit be88300071
5 changed files with 42 additions and 20 deletions

View File

@@ -6,6 +6,7 @@
import os
import sys
import pytest
import gc
sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir))
from pyocf.types.logger import LogLevel, DefaultLogger, BufferLogger
@@ -24,6 +25,7 @@ def pyocf_ctx():
c.register_volume_type(ErrorDevice)
yield c
c.exit()
gc.collect()
@pytest.fixture()
@@ -34,3 +36,4 @@ def pyocf_ctx_log_buffer():
c.register_volume_type(ErrorDevice)
yield logger
c.exit()
gc.collect()