More temporary mochitest hang diagnostics: kill the plugin process with SIGSEGV if it doesn't shut down within 30 seconds.

This commit is contained in:
Chris Jones 2010-01-25 18:49:02 -06:00
Родитель 014c914720
Коммит 716e3b9b25
1 изменённых файлов: 16 добавлений и 5 удалений

Просмотреть файл

@ -122,14 +122,25 @@ protected:
#if 0
HANDLE_EINTR(waitpid(process_, NULL, 0));
#else
const int maxWaits = 30;
int waits = 0;
while (!IsProcessDead(process_) && ++waits < maxWaits)
sleep(1);
printf("TEST-UNEXPECTED-FAIL | process %d done busy-waiting on | child process %d\n", getpid(), process_);
if (waits < maxWaits) {
printf("TEST-UNEXPECTED-FAIL | process %d done busy-waiting on | child process %d\n", getpid(), process_);
}
else {
printf("TEST-UNEXPECTED-FAIL | process %d wait on | child process %d timed out!\n", getpid(), process_);
// kill the child in such a way that breakpad is triggered
kill(process_, SIGSEGV);
HANDLE_EINTR(waitpid(process_, NULL, 0));
}
#endif