[Checkins] [zopefoundation/zope.testrunner] 1cfd75: Read stderr from layer subprocesses in a thread

Colin Watson noreply at github.com
Fri Jun 19 11:18:03 CEST 2020


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.testrunner
  Commit: 1cfd75f31c9b05597a67897187c90338b1a0517c
      https://github.com/zopefoundation/zope.testrunner/commit/1cfd75f31c9b05597a67897187c90338b1a0517c
  Author: Colin Watson <cjwatson at debian.org>
  Date:   2020-06-19 (Fri, 19 Jun 2020)

  Changed paths:
    M CHANGES.rst
    M src/zope/testrunner/runner.py
    A src/zope/testrunner/tests/testrunner-ex/sampletests_many.py
    M src/zope/testrunner/tests/testrunner-layers-ntd.rst

  Log Message:
  -----------
  Read stderr from layer subprocesses in a thread

If the test runner runs a layer in a subprocess (due to not being able
to tear down a previous layer), then the child process communicates the
IDs of any tests that fail or error to its parent by a simple protocol
over its stderr.  However, the parent doesn't start reading this until
it's finished reading everything from the child's stdout and its end of
the pipe corresponding to the child's stdout signals end-of-file, which
isn't going to happen until the child finishes writing everything to
stderr and exits.  This can result in a deadlock if the child process
encounters enough failures or errors that their test IDs overflow the
capacity of a pipe, which on Linux >= 2.6.11 is 65536 bytes.

To avoid this, read the child's stderr in a thread.  (On Unix, we could
use select instead, but that doesn't work for pipes on Windows, and
we're already using threads here anyway.)

Fixes #105.


  Commit: bc3140808b6498c4586b629d9370ebf1ea24f041
      https://github.com/zopefoundation/zope.testrunner/commit/bc3140808b6498c4586b629d9370ebf1ea24f041
  Author: Colin Watson <cjwatson at debian.org>
  Date:   2020-06-19 (Fri, 19 Jun 2020)

  Changed paths:
    M CHANGES.rst
    M src/zope/testrunner/runner.py
    A src/zope/testrunner/tests/testrunner-ex/sampletests_many.py
    M src/zope/testrunner/tests/testrunner-layers-ntd.rst

  Log Message:
  -----------
  Merge pull request #106 from cjwatson/subprocess-stderr-thread

Read stderr from layer subprocesses in a thread


Compare: https://github.com/zopefoundation/zope.testrunner/compare/baf5486f766d...bc3140808b64


More information about the checkins mailing list