I've been annoyed for months that test/src/process-tests.el occasionally failed on my work desktop, and finally got annoyed enough to track it down. It was a race condition bug, fixed in the attached patch. I looked for similar instances of the bug elsewhere in Emacs, and found what appear to be some instances in Tramp code, along with some mysterious "0.1"s that may be inadequate attempts to work around the bug. I installed the attached patch to try to document and fix this mess, including some FIXMEs about those "0.1"s; I hope Michael or someone else with Tramp expertise (I don't use Tramp) can take a look at those FIXMEs and at my other Tramp changes, and perhaps at all other Tramp uses of accept-process-output and of tramp-accept-process-output. Now that I'm thinking about it, I should also mention that a single (accept-process-output P) is not guaranteed to slurp all the data from process P even if P has already exited. Just a word to the wise....