Do not wait on std{out,err} when a test times out.
authorPat Gavlin <pagavlin@microsoft.com>
Tue, 14 Mar 2017 17:05:26 +0000 (10:05 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Tue, 14 Mar 2017 17:25:14 +0000 (10:25 -0700)
commitd3a2f82ff3f6a316a3b9c8db428b69de5a382407
treebfa96c8291d74c8b42fab10590d9bc06acd794b0
parentd488016a76003b9d713a19a8f18c01abfdd12d4a
Do not wait on std{out,err} when a test times out.

The test wrapper currently waits on each of the process, stdout copy,
and stderr copy in turn. This makes it difficult to determine whether
or not the test did in fact time out, as the time in which it may
write to its output streams is effectively twice or thrice the
time used to determine success or failure (i.e. the process wait
timeout). This can cause situations like what we've seen in dotnet/coreclr#10076,
where the harness reports that the process timed out but the test's
output indicates a successful run.

This change only waits on stdout/stderr if the process completes within
the time allotted; otherwise it cancels the copies and promptly reports
the timeout.

Commit migrated from https://github.com/dotnet/coreclr/commit/bd7a88958776655867a4af3184dfef317f33839d
src/coreclr/tests/src/Common/Coreclr.TestWrapper/CoreclrTestWrapperLib.cs