Commit 45867618 authored by Camillo's avatar Camillo Committed by V8 LUCI CQ

[tools] Fully implement linux-perf tools --timeout

Change-Id: I462af434a695a09c9b65b11759e01aace463b414
No-Try: True
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3755147
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81641}
parent db1a66b5
......@@ -5,6 +5,7 @@
import optparse
from pathlib import Path
from datetime import datetime, timedelta
import os
import shlex
import subprocess
......@@ -114,8 +115,11 @@ JS_FLAGS_PERF = ("--perf-prof", "--no-write-protect-code-memory",
def wait_for_process_timeout(process):
sleeping_time = 0
while (sleeping_time < options.timeout):
delta = timedelta(seconds=options.timeout)
start_time = datetime.now()
while True:
if (datetime.now() - start_time) >= delta:
return False
processHasStopped = process.poll() is not None
if processHasStopped:
return True
......
......@@ -3,7 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from datetime import datetime
from datetime import datetime, timedelta
from pathlib import Path
import optparse
import os
......@@ -166,8 +166,11 @@ log("LINUX PERF CMD: ", shlex.join(cmd))
def wait_for_process_timeout(process):
sleeping_time = 0
while (sleeping_time < options.timeout):
delta = timedelta(seconds=options.timeout)
start_time = datetime.now()
while True:
if (datetime.now() - start_time) >= delta:
return False
processHasStopped = process.poll() is not None
if processHasStopped:
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment