Skip to content

Commit 78e5ada

Browse files
committed
Catch RuntimeError when starting InfluxDB
1 parent b5f1311 commit 78e5ada

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

influxdb/tests/server_tests/influxdb_instance.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ def __init__(self,
3131

3232
self.influxd_path = self.find_influxd_path()
3333

34+
errors = 0
35+
while True:
36+
try:
37+
self._start_server(conf_template, udp_enabled)
38+
break
39+
except RuntimeError: # Happens when the ports are already in use.
40+
errors += 1
41+
if errors > 2:
42+
raise e
43+
44+
def _start_server(self, conf_template, udp_enabled):
45+
3446
# create a temporary dir to store all needed files
3547
# for the influxdb server instance :
3648
self.temp_dir_base = tempfile.mkdtemp()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy