Skip to content

Commit 59ab251

Browse files
Yifan ZhangYifan Zhang
authored andcommitted
loosen the start-up timeout check - ignore timeout if a driver is already started upon the first started_check
1 parent 925a159 commit 59ab251

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

  • testplan/testing/environment

testplan/testing/environment/base.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,22 +146,24 @@ def start(self):
146146
res = None
147147
if watch.should_check():
148148
res = driver.started_check()
149-
if time.time() >= watch.start_time + watch.total_wait:
150-
# we got a timed-out here
151-
if res:
152-
raise TimeoutException(
153-
f"Timeout when starting {driver} despite it's probably started now. "
154-
f"{TimeoutExceptionInfo(watch.start_time).msg()}"
155-
)
156-
else:
157-
raise TimeoutException(
158-
f"Timeout when starting {driver}. "
159-
f"{TimeoutExceptionInfo(watch.start_time).msg()}"
160-
)
161149
if res:
150+
if time.time() >= watch.start_time + watch.total_wait:
151+
driver.logger.error(
152+
"Timeout when starting %s despite"
153+
" it's probably started now. %s",
154+
driver,
155+
TimeoutExceptionInfo(
156+
watch.start_time
157+
).msg(),
158+
)
162159
driver._after_started()
163160
driver.logger.info("%s started", driver)
164161
self._rt_dependency.mark_processed(driver)
162+
elif time.time() >= watch.start_time + watch.total_wait:
163+
raise TimeoutException(
164+
f"Timeout when starting {driver}. "
165+
f"{TimeoutExceptionInfo(watch.start_time).msg()}"
166+
)
165167
except Exception:
166168
self._record_resource_exception(
167169
message="While waiting for driver {resource} to start:\n"

0 commit comments

Comments
 (0)