diff options
author | Jürg Billeter <j@bitron.ch> | 2019-08-06 15:32:15 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-08-20 07:41:23 +0200 |
commit | 6613dd90fd5b497633da61291c7dc63c7b1f6092 (patch) | |
tree | 1e6bbe13293e06c706101eaf2eea651aa4a7a1d6 /tests | |
parent | 3e8b021464a87a61a9b16cb4970ecc12acc3b958 (diff) | |
download | buildstream-6613dd90fd5b497633da61291c7dc63c7b1f6092.tar.gz |
casserver.py: Call CASCache.release_resources() on exit
Install a signal handler to execute cleanup also on SIGTERM. This will
be used to terminate the buildbox-casd child process.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testutils/artifactshare.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/testutils/artifactshare.py b/tests/testutils/artifactshare.py index a5522c8eb..42ac6a6af 100644 --- a/tests/testutils/artifactshare.py +++ b/tests/testutils/artifactshare.py @@ -84,24 +84,24 @@ class ArtifactShare(): self.free_space = self.total_space os.statvfs = self._mock_statvfs - server = create_server(self.repodir, - max_head_size=self.max_head_size, - min_head_size=self.min_head_size, - enable_push=True) - port = server.add_insecure_port('localhost:0') + with create_server(self.repodir, + max_head_size=self.max_head_size, + min_head_size=self.min_head_size, + enable_push=True) as server: + port = server.add_insecure_port('localhost:0') - server.start() + server.start() - # Send port to parent - q.put(port) + # Send port to parent + q.put(port) + + # Sleep until termination by signal + signal.pause() except Exception: q.put(None) raise - # Sleep until termination by signal - signal.pause() - # has_object(): # # Checks whether the object is present in the share |