Commit 72b28e65 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Dump processes when test driver hangs

This prints the current v8-specific processes on linux whenever the
test driver emits a heart beat (i.e. no output for 30 seconds).

This is to investigate the cause of currently hanging tests on linux.

Bug: v8:9145
Change-Id: I857bb6d1c5f0b0917c64cdc0aa6076c6633f9dd6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1578438
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarTamer Tas <tmrts@chromium.org>
Reviewed-by: 's avatarSergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60941}
parent 06d750b5
......@@ -7,12 +7,19 @@ from __future__ import print_function
import json
import os
import platform
import subprocess
import sys
import time
from . import base
# Base dir of the build products for Release and Debug.
OUT_DIR = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', '..', '..', 'out'))
def print_failure_header(test):
if test.output_proc.negative:
negative_marker = '[negative] '
......@@ -120,11 +127,26 @@ class VerboseProgressIndicator(SimpleProgressIndicator):
self._print('Done running %s %s: %s' % (
test, test.variant or 'default', outcome))
# TODO(machenbach): Remove this platform specific hack and implement a proper
# feedback channel from the workers, providing which tests are currently run.
def _print_processes_linux(self):
if platform.system() == 'Linux':
try:
cmd = 'ps -aux | grep "%s"' % OUT_DIR
output = subprocess.check_output(cmd, shell=True)
self._print('List of processes:')
for line in (output or '').splitlines():
# Show only command with process info cut off.
self._print(line[line.index(OUT_DIR):])
except:
pass
def _on_heartbeat(self):
if time.time() - self._last_printed_time > 30:
# Print something every 30 seconds to not get killed by an output
# timeout.
self._print('Still working...')
self._print_processes_linux()
class DotsProgressIndicator(SimpleProgressIndicator):
......
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