just kill python instead of trying to shut it down gracefully, in tests

This commit is contained in:
Arvid Norberg 2013-09-30 17:17:11 +00:00
parent a577dac775
commit f8261494e0
1 changed files with 2 additions and 6 deletions

View File

@ -388,15 +388,11 @@ void stop_all_proxies()
{
#ifdef _WIN32
HANDLE proc = OpenProcess(PROCESS_TERMINATE | SYNCHRONIZE, FALSE, i->second.pid);
GenerateConsoleCtrlEvent(CTRL_C_EVENT, i->second.pid);
int ret = WaitForSingleObject(proc, 1000);
// if the process didn't terminate in 1 second, kill it
if (ret != WAIT_OBJECT_0)
TerminateProcess(proc, 138);
TerminateProcess(proc, 138);
CloseHandle(proc);
#else
printf("killing pid: %d\n", i->second.pid);
kill(i->second.pid, SIGINT);
kill(i->second.pid, SIGKILL);
#endif
running_proxies.erase(i->second.pid);
}