Skip to content

Commit c4d5241

Browse files
committed
remove timeout 90% margin
Signed-off-by: Ivy Zhang <[email protected]>
1 parent 2b0fa24 commit c4d5241

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

tests/integration/defs/trt_test_alternative.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ def call(*popenargs,
208208
poll_procs = poll_procs or []
209209
if not suppress_output_info:
210210
print(f"Start subprocess with call({popenargs}, {kwargs})")
211-
timeout = get_pytest_timeout(timeout)
212-
if timeout is None:
213-
actual_timeout = None
214-
else:
215-
actual_timeout = max(30, int(timeout * 0.9))
216211
with popen(*popenargs,
217212
start_new_session=start_new_session,
218213
suppress_output_info=True,
@@ -223,7 +218,7 @@ def call(*popenargs,
223218
return p.wait(timeout=spin_time)
224219
except subprocess.TimeoutExpired:
225220
elapsed_time += spin_time
226-
if actual_timeout is not None and elapsed_time >= actual_timeout:
221+
if timeout is not None and elapsed_time >= timeout:
227222
raise
228223
for p_poll in poll_procs:
229224
if p_poll.poll() is None:
@@ -327,28 +322,3 @@ def check_call_negative_test(*popenargs, **kwargs):
327322
f"Subprocess expected to fail with check_call_negative_test({popenargs}, {kwargs}), but passed."
328323
)
329324
raise subprocess.CalledProcessError(1, cmd)
330-
331-
332-
def get_pytest_timeout(timeout=None):
333-
if timeout:
334-
return timeout
335-
336-
try:
337-
import sys
338-
for i, arg in enumerate(sys.argv):
339-
if arg == '--timeout' and i + 1 < len(sys.argv):
340-
try:
341-
timeout = int(sys.argv[i + 1])
342-
except ValueError:
343-
pass
344-
elif arg.startswith('--timeout='):
345-
try:
346-
timeout = int(arg.split('=', 1)[1])
347-
except ValueError:
348-
pass
349-
if timeout and isinstance(timeout, (int, float)):
350-
return timeout
351-
except (ImportError, Exception):
352-
pass
353-
354-
return timeout

0 commit comments

Comments
 (0)