mongobox
mongobox copied to clipboard
Second start fails when dbpath is specified
Using nose2 plugin with this config:
[unittest]
plugins = mongobox.nose2_plugin
[mongobox]
port = 27018
dbpath = /run/shm/mongobox
When I start the tests directory /run/shm/mongobox
is created. But it's not removed when the server stops. mongobox.mongobox.MongoBox#stop
:
if self._db_path_is_temporary:
shutil.rmtree(self.db_path)
self.db_path = None
The directory is there:
$ du -sh /run/shm/mongobox
65M /run/shm/mongobox
When I start the tests second time:
File "/home/vic/projects/venv/brain2/local/lib/python2.7/site-packages/mongobox/nose2_plugin.py", line 62, in pluginsLoaded
self.mongobox.start()
File "/home/vic/projects/venv/brain2/local/lib/python2.7/site-packages/mongobox/mongobox.py", line 89, in start
return self._wait_till_started()
File "/home/vic/projects/venv/brain2/local/lib/python2.7/site-packages/mongobox/mongobox.py", line 134, in _wait_till_started
self.stop()
File "/home/vic/projects/venv/brain2/local/lib/python2.7/site-packages/mongobox/mongobox.py", line 100, in stop
os.kill(self.process.pid, 9)
OSError: [Errno 3] No such process
Looks like because the directory was not removed it thinks that the server is still running.
Am I supposed to remove the directory manually?