def setUp(self): self.cinder = MockCinder() self.scratch = mkdtemp() self.stats_path = os.path.join(self.scratch, 'stats') self.stat_queue = multiprocessing.Queue() with JsonLockFile(self.stats_path) as lock: self.stats_lock = lock self.volume_id = 'volume_id' self.block_count = 10 self.process = StatsRestoreProcess(self.cinder, self.volume_id, self.stat_queue, self.block_count, self.stats_lock, update_interval=1) self.process.start()