summaryrefslogtreecommitdiff
path: root/src/mongo/unittest/death_test.cpp
diff options
context:
space:
mode:
authorADAM David Alan Martin <adam.martin@10gen.com>2019-06-20 11:26:17 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-06-20 11:26:17 -0400
commiteaea346cf909c8dd6c9625a7737a2fec671ed04f (patch)
treee0f8fad81ba9617a0de5db6271655243ab19d0c6 /src/mongo/unittest/death_test.cpp
parent6c40059b844273f9b370a560c211ef14268f45a4 (diff)
downloadmongo-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/death_test.cpp')
-rw-r--r--src/mongo/unittest/death_test.cpp4
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;