Skip to content

Commit 1c379ae

Browse files
committed
Add retries for starting test worker
1 parent bbd6e46 commit 1c379ae

File tree

1 file changed

+8
-6
lines changed
  • graalpython/com.oracle.graal.python.test/src

1 file changed

+8
-6
lines changed

graalpython/com.oracle.graal.python.test/src/runner.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -744,17 +744,19 @@ def run_in_subprocess_and_watch(self):
744744
]
745745
if self.runner.failfast:
746746
cmd.append('--failfast')
747-
self.process = subprocess.Popen(cmd, stdout=self.out_file, stderr=self.out_file)
748747

749-
server.settimeout(180.0)
748+
self.process = None
750749
try:
750+
self.process = subprocess.Popen(cmd, stdout=self.out_file, stderr=self.out_file)
751+
server.settimeout(180.0)
751752
sock = server.accept()[0]
752-
except TimeoutError:
753-
interrupt_process(self.process)
753+
except (TimeoutError, OSError):
754+
if self.process:
755+
interrupt_process(self.process)
754756
retries -= 1
755757
if retries:
756758
continue
757-
sys.exit("Worker failed to connect to runner multiple times")
759+
sys.exit("Worker failed to start/connect to runner multiple times")
758760

759761
with sock:
760762
conn = Connection(sock)

0 commit comments

Comments
 (0)