Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions 22 Lib/test/libregrtest/runtest_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,27 +120,28 @@ def __init__(self, worker_id, pending, output, ns, timeout):
def __repr__(self):
info = [f'TestWorkerProcess #{self.worker_id}']
if self.is_alive():
dt = time.monotonic() - self.start_time
info.append("running for %s" % format_duration(dt))
info.append("running")
else:
info.append('stopped')
test = self.current_test_name
if test:
info.append(f'test={test}')
popen = self._popen
if popen:
info.append(f'pid={popen.pid}')
if popen is not None:
dt = time.monotonic() - self.start_time
info.extend((f'pid={self._popen.pid}',
f'time={format_duration(dt)}'))
return '<%s>' % ' '.join(info)

def _kill(self):
if self._killed:
return
self._killed = True

popen = self._popen
if popen is None:
return

if self._killed:
return
self._killed = True

print(f"Kill {self}", file=sys.stderr, flush=True)
try:
popen.kill()
Expand Down Expand Up @@ -177,9 +178,10 @@ def _run_process(self, test_name):

self.current_test_name = test_name
try:
popen = run_test_in_subprocess(test_name, self.ns)

self._killed = False
self._popen = run_test_in_subprocess(test_name, self.ns)
popen = self._popen
self._popen = popen
except:
self.current_test_name = None
raise
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.