summaryrefslogtreecommitdiff
path: root/tests/testutils/artifactshare.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testutils/artifactshare.py')
-rw-r--r--tests/testutils/artifactshare.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/testutils/artifactshare.py b/tests/testutils/artifactshare.py
index 5194e83cf..31b96be73 100644
--- a/tests/testutils/artifactshare.py
+++ b/tests/testutils/artifactshare.py
@@ -67,19 +67,24 @@ class ArtifactShare():
def run(self, q):
pytest_cov.embed.cleanup_on_sigterm()
- # Optionally mock statvfs
- if self.total_space:
- if self.free_space is None:
- self.free_space = self.total_space
- os.statvfs = self._mock_statvfs
+ try:
+ # Optionally mock statvfs
+ if self.total_space:
+ if self.free_space is None:
+ self.free_space = self.total_space
+ os.statvfs = self._mock_statvfs
+
+ server = create_server(self.repodir, enable_push=True)
+ port = server.add_insecure_port('localhost:0')
- server = create_server(self.repodir, enable_push=True)
- 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)
+ except Exception as e:
+ q.put(None)
+ raise
# Sleep until termination by signal
signal.pause()