Skip to content

merge_pr_13447: [wptrunner] Discard corrupted message queues (#13447)

Compare
Choose a tag to compare
@jgraham jgraham released this 10 Oct 20:27
· 28155 commits to master since this release
"TestRunner" sub-processes forward their standard output streams to the
"TestRunnerManager" process via a Python multiprocessing Queue. When
such a process produces a large amount of output (e.g. in failing
WebDriver specification tests), the data may be buffered in the
underlying operating system pipe. In this state, such a process will not
exit naturally:

> Bear in mind that a process that has put items in a queue will wait
> before terminating until all the buffered items are fed by the
> "feeder" thread to the underlying pipe. [1]

Previously, the TestRunnerManager forcibly terminated the sub-process
and re-used the message queue, providing it to a new sub-process and
waiting for new items to be inserted. However, the queue's behavior is
unpredictable in this state. It has been observed to block indefinitely
on GNU/Linux and macOS systems [2].

To avoid this behavior, discard the queue and create a new instance for
use in subsequent tests.

[1] https://docs.python.org/2/library/multiprocessing.html#all-platforms
[2] https://github.com/web-platform-tests/wpt/issues/13446