Commit 70c998c1 authored by Kirill Smelkov's avatar Kirill Smelkov

tests: Keep ZEO test database on /tmp/

We already keep FileStorage test database on /tmp/ and NEO itself (via
neo.tests.functional.NEOCluster) also keeps test data on tmpfs. However
test database for ZEO was created in current directory and was wearing
out SSD unnecessarily.

FIXME zeo_forker currently does not provide API to keep all server files
in particular place. This way server conf and log are still emitted in
current directory, but at least we move data.fs away. Since conf and log
are uniquely named, e.g. server-<ΧΧΧ>.conf and tmpYYY.log, and it was
only that Data.fs was named non-uniquely, by moving Data.fs into unique
per-server place, this also helps with-ZEO tests to execute correctly in
parallel with `tox -p`.
parent 6af25d90
# Wendelin. Testing utilities # Wendelin. Testing utilities
# Copyright (C) 2014-2015 Nexedi SA and Contributors. # Copyright (C) 2014-2019 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com> # Kirill Smelkov <kirr@nexedi.com>
# #
# This program is free software: you can Use, Study, Modify and Redistribute # This program is free software: you can Use, Study, Modify and Redistribute
...@@ -259,9 +259,11 @@ class TestDB_ZEO(TestDB_Base): ...@@ -259,9 +259,11 @@ class TestDB_ZEO(TestDB_Base):
def setup(self): def setup(self):
self.tmpd = mkdtemp('', 'testdb_zeo.')
port = self.zeo_forker.get_port() port = self.zeo_forker.get_port()
zconf = self.zeo_forker.ZEOConfig(('', port)) zconf = self.zeo_forker.ZEOConfig(('', port))
_ = self.zeo_forker.start_zeo_server(zeo_conf=zconf, port=port) _ = self.zeo_forker.start_zeo_server(path='%s/1.fs' % self.tmpd, zeo_conf=zconf, port=port)
if self.z5: if self.z5:
self.addr, self.stop = _ self.addr, self.stop = _
else: else:
...@@ -274,6 +276,8 @@ class TestDB_ZEO(TestDB_Base): ...@@ -274,6 +276,8 @@ class TestDB_ZEO(TestDB_Base):
self.zeo_forker.shutdown_zeo_server(self.adminaddr) self.zeo_forker.shutdown_zeo_server(self.adminaddr)
os.waitpid(self.pid, 0) os.waitpid(self.pid, 0)
rmtree(self.tmpd)
def getZODBStorage(self): def getZODBStorage(self):
from ZEO.ClientStorage import ClientStorage from ZEO.ClientStorage import ClientStorage
return ClientStorage(self.addr) return ClientStorage(self.addr)
......
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