Skip to content

Commit 710fc03

Browse files
authored
Merge pull request #292 from Venkat-Kunaparaju/http-duration
Run HTTP test curl once and use duration as timeout directly
2 parents 264c984 + c0f6c29 commit 710fc03

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

testTypeHttp.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,18 @@ def _thread_action() -> BaseOutput:
9797
else:
9898
_check_success = _check_success_podman
9999

100-
sleep_time = 0.2
101-
end_timestamp = time.monotonic() + self.get_duration() - sleep_time
102-
103-
while True:
100+
if expects_blocked:
101+
sleep_time = 0.2
102+
end_timestamp = time.monotonic() + self.get_duration() - sleep_time
103+
while True:
104+
r = self.run_oc_exec(cmd, may_fail=expects_blocked)
105+
if not _check_success(r):
106+
break
107+
if time.monotonic() >= end_timestamp:
108+
break
109+
time.sleep(sleep_time)
110+
else:
104111
r = self.run_oc_exec(cmd, may_fail=expects_blocked)
105-
if not _check_success(r):
106-
break
107-
if time.monotonic() >= end_timestamp:
108-
break
109-
time.sleep(sleep_time)
110112

111113
self.ts.event_client_finished.set()
112114

0 commit comments

Comments
 (0)