Bug 550425: Bump up the timeout for expensive deadlock tests and print more info on failures. r=bsmedberg,sdwilsh

This commit is contained in:
Chris Jones 2010-03-24 19:12:32 -05:00
parent e4aea6bfca
commit 014cb688de
2 changed files with 25 additions and 12 deletions

View File

@ -218,6 +218,7 @@ public:
NS_ASSERTION(0 <= rv, PR_ErrorToName(PR_GetError()));
if (0 == rv) { // timeout
fputs("(timed out!)\n", stderr);
Finish(PR_FALSE); // abnormal
return;
}
@ -246,21 +247,24 @@ public:
else
mStderr += buf;
}
else if (isStdout) {
stdoutOpen = PR_FALSE;
}
else {
if (isStdout) {
stdoutOpen = PR_FALSE;
PR_Close(mStdoutfd);
}
else {
stderrOpen = PR_FALSE;
PR_Close(mStderrfd);
}
stderrOpen = PR_FALSE;
}
}
now = PR_IntervalNow();
}
if (stdoutOpen)
fputs("(stdout still open!)\n", stderr);
if (stderrOpen)
fputs("(stderr still open!)\n", stderr);
if (now > deadline)
fputs("(timed out!)\n", stderr);
Finish(!stdoutOpen && !stderrOpen && now <= deadline);
}
@ -268,8 +272,6 @@ private:
void Finish(PRBool normalExit) {
if (!normalExit) {
PR_KillProcess(mProc);
PR_Close(mStdoutfd);
PR_Close(mStderrfd);
mExitCode = -1;
PRInt32 dummy;
PR_WaitProcess(mProc, &dummy);
@ -277,6 +279,9 @@ private:
else {
PR_WaitProcess(mProc, &mExitCode); // this had better not block ...
}
PR_Close(mStdoutfd);
PR_Close(mStderrfd);
}
PRProcess* mProc;
@ -559,7 +564,7 @@ ContentionNoDeadlock()
{
const char * func = __func__;
Subprocess proc(func);
proc.RunToCompletion(10000);
proc.RunToCompletion(60000);
if (0 != proc.mExitCode) {
printf("(expected 0 == return code, got %d)\n", proc.mExitCode);
puts("(output)\n----------------------------------\n");

View File

@ -180,6 +180,7 @@ public:
NS_ASSERTION(0 <= rv, PR_ErrorToName(PR_GetError()));
if (0 == rv) { // timeout
fputs("(timed out!)\n", stderr);
Finish(PR_FALSE); // abnormal
return;
}
@ -219,6 +220,13 @@ public:
now = PR_IntervalNow();
}
if (stdoutOpen)
fputs("(stdout still open!)\n", stderr);
if (stderrOpen)
fputs("(stderr still open!)\n", stderr);
if (now > deadline)
fputs("(timed out!)\n", stderr);
Finish(!stdoutOpen && !stderrOpen && now <= deadline);
}
@ -518,7 +526,7 @@ ContentionNoDeadlock()
{
const char * func = __func__;
Subprocess proc(func);
proc.RunToCompletion(10000);
proc.RunToCompletion(60000);
if (0 != proc.mExitCode) {
printf("(expected 0 == return code, got %d)\n", proc.mExitCode);
puts("(output)\n----------------------------------\n");