diff options
author | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-06-20 11:26:17 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-06-20 11:26:17 -0400 |
commit | eaea346cf909c8dd6c9625a7737a2fec671ed04f (patch) | |
tree | e0f8fad81ba9617a0de5db6271655243ab19d0c6 /src/mongo/unittest | |
parent | 6c40059b844273f9b370a560c211ef14268f45a4 (diff) | |
download | mongo-eaea346cf909c8dd6c9625a7737a2fec671ed04f.tar.gz |
SERVER-41162 Show logs for death tests.
Death tests run in a child process. That process communicates its
stdout and stderr to its parent via a pipe. The results are
searched for a death-test string. We now output the child's
output to the parent's stream, after collecting it for a later
search.
Diffstat (limited to 'src/mongo/unittest')
-rw-r--r-- | src/mongo/unittest/death_test.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/unittest/death_test.cpp b/src/mongo/unittest/death_test.cpp index 08d3fae9f17..04d8ed135bd 100644 --- a/src/mongo/unittest/death_test.cpp +++ b/src/mongo/unittest/death_test.cpp @@ -81,10 +81,14 @@ void DeathTestImpl::_doTest() { char buf[1000]; std::ostringstream os; ssize_t bytesRead; + log() << "========== Beginning Interleaved output of Death Test =========="; while (0 < (bytesRead = read(pipes[0], buf, sizeof(buf)))) { + std::cerr.write(buf, bytesRead); + invariant(std::cerr); os.write(buf, bytesRead); invariant(os); } + log() << "========== Beginning Interleaved output of Death Test =========="; checkSyscall(bytesRead); pid_t pid; int stat; |