|
|
@ -10,6 +10,7 @@ import time
|
|
|
|
import mock
|
|
|
|
import mock
|
|
|
|
import unittest2
|
|
|
|
import unittest2
|
|
|
|
import testlib
|
|
|
|
import testlib
|
|
|
|
|
|
|
|
from testlib import Popen__terminate
|
|
|
|
|
|
|
|
|
|
|
|
import mitogen.parent
|
|
|
|
import mitogen.parent
|
|
|
|
|
|
|
|
|
|
|
@ -269,7 +270,7 @@ class IterReadTest(testlib.TestCase):
|
|
|
|
if i > 3:
|
|
|
|
if i > 3:
|
|
|
|
break
|
|
|
|
break
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
proc.terminate()
|
|
|
|
Popen__terminate(proc)
|
|
|
|
proc.stdout.close()
|
|
|
|
proc.stdout.close()
|
|
|
|
|
|
|
|
|
|
|
|
def test_deadline_exceeded_before_call(self):
|
|
|
|
def test_deadline_exceeded_before_call(self):
|
|
|
@ -284,7 +285,7 @@ class IterReadTest(testlib.TestCase):
|
|
|
|
except mitogen.core.TimeoutError:
|
|
|
|
except mitogen.core.TimeoutError:
|
|
|
|
self.assertEqual(len(got), 0)
|
|
|
|
self.assertEqual(len(got), 0)
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
proc.terminate()
|
|
|
|
Popen__terminate(proc)
|
|
|
|
proc.stdout.close()
|
|
|
|
proc.stdout.close()
|
|
|
|
|
|
|
|
|
|
|
|
def test_deadline_exceeded_during_call(self):
|
|
|
|
def test_deadline_exceeded_during_call(self):
|
|
|
@ -306,7 +307,7 @@ class IterReadTest(testlib.TestCase):
|
|
|
|
self.assertLess(1, len(got))
|
|
|
|
self.assertLess(1, len(got))
|
|
|
|
self.assertLess(len(got), 20)
|
|
|
|
self.assertLess(len(got), 20)
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
proc.terminate()
|
|
|
|
Popen__terminate(proc)
|
|
|
|
proc.stdout.close()
|
|
|
|
proc.stdout.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -326,7 +327,7 @@ class WriteAllTest(testlib.TestCase):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.func(proc.stdin.fileno(), self.ten_ms_chunk)
|
|
|
|
self.func(proc.stdin.fileno(), self.ten_ms_chunk)
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
proc.terminate()
|
|
|
|
Popen__terminate(proc)
|
|
|
|
proc.stdin.close()
|
|
|
|
proc.stdin.close()
|
|
|
|
|
|
|
|
|
|
|
|
def test_deadline_exceeded_before_call(self):
|
|
|
|
def test_deadline_exceeded_before_call(self):
|
|
|
@ -336,7 +337,7 @@ class WriteAllTest(testlib.TestCase):
|
|
|
|
lambda: self.func(proc.stdin.fileno(), self.ten_ms_chunk, 0)
|
|
|
|
lambda: self.func(proc.stdin.fileno(), self.ten_ms_chunk, 0)
|
|
|
|
))
|
|
|
|
))
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
proc.terminate()
|
|
|
|
Popen__terminate(proc)
|
|
|
|
proc.stdin.close()
|
|
|
|
proc.stdin.close()
|
|
|
|
|
|
|
|
|
|
|
|
def test_deadline_exceeded_during_call(self):
|
|
|
|
def test_deadline_exceeded_during_call(self):
|
|
|
@ -349,7 +350,7 @@ class WriteAllTest(testlib.TestCase):
|
|
|
|
deadline)
|
|
|
|
deadline)
|
|
|
|
))
|
|
|
|
))
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
proc.terminate()
|
|
|
|
Popen__terminate(proc)
|
|
|
|
proc.stdin.close()
|
|
|
|
proc.stdin.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|