Commit ffaa2474 authored by Denis Bilenko's avatar Denis Bilenko

Fix tests to pass on debug python

- test__backdoor.py: do not use create_connection
  it uses getaddrinfo and that may trigger unrelated issues
- test___monkey_patching.py: set timeout to 60
- test__socket_dns.py: wait for the thread pool
parent 786ced62
......@@ -5,7 +5,7 @@ import util
import atexit
TIMEOUT = 45
TIMEOUT = 60
directory = '%s.%s' % sys.version_info[:2]
version = '%s.%s.%s' % sys.version_info[:3]
......
......@@ -14,6 +14,12 @@ def read_until(conn, postfix):
return read
def create_connection(address):
conn = socket.socket()
conn.connect(address)
return conn
class Test(greentest.TestCase):
def test(self):
......@@ -21,7 +27,7 @@ class Test(greentest.TestCase):
server.start()
def connect():
conn = socket.create_connection(('127.0.0.1', server.server_port))
conn = create_connection(('127.0.0.1', server.server_port))
read_until(conn, '>>> ')
conn.sendall('2+2\r\n')
line = conn.makefile().readline()
......@@ -36,7 +42,7 @@ class Test(greentest.TestCase):
server = backdoor.BackdoorServer(('127.0.0.1', 0))
server.start()
try:
conn = socket.create_connection(('127.0.0.1', server.server_port))
conn = create_connection(('127.0.0.1', server.server_port))
read_until(conn, '>>> ')
conn.sendall('quit()\r\n')
line = conn.makefile().read()
......@@ -48,7 +54,7 @@ class Test(greentest.TestCase):
server = backdoor.BackdoorServer(('127.0.0.1', 0))
server.start()
try:
conn = socket.create_connection(('127.0.0.1', server.server_port))
conn = create_connection(('127.0.0.1', server.server_port))
read_until(conn, '>>> ')
conn.sendall('import sys; sys.exit(0)\r\n')
line = conn.makefile().read()
......@@ -61,7 +67,7 @@ class Test(greentest.TestCase):
server = backdoor.BackdoorServer(('127.0.0.1', 0), banner=banner)
server.start()
try:
conn = socket.create_connection(('127.0.0.1', server.server_port))
conn = create_connection(('127.0.0.1', server.server_port))
response = read_until(conn, '>>> ')
self.assertEqual(response[:len(banner)], banner)
finally:
......@@ -71,7 +77,7 @@ class Test(greentest.TestCase):
server = backdoor.BackdoorServer(('127.0.0.1', 0))
server.start()
try:
conn = socket.create_connection(('127.0.0.1', server.server_port))
conn = create_connection(('127.0.0.1', server.server_port))
read_until(conn, '>>> ')
conn.sendall('locals()["__builtins__"]\r\n')
response = read_until(conn, '>>> ')
......
......@@ -375,6 +375,9 @@ class TestInterrupted_gethostbyname(greentest.GenericWaitTestCase):
pass
raise AssertionError('Timeout was not raised')
def cleanup(self):
gevent.get_hub().threadpool.join()
# class TestInterrupted_getaddrinfo(greentest.GenericWaitTestCase):
#
......
......@@ -12,8 +12,6 @@ win32 * C:\Python27\python.exe -u test__core_stat.py
# other Windows-related issues (need investigating)
win32 * C:\Python27\python.exe -u -m monkey_test test_threading.py
win32 * C:\Python27\python.exe -u -m monkey_test --Event test_threading.py
win32 * C:\Python27\python.exe -u -m monkey_test test_telnetlib.py
win32 * C:\Python27\python.exe -u -m monkey_test --Event test_telnetlib.py
win32 * C:\Python27\python.exe -u -m monkey_test test_subprocess.py
win32 * C:\Python27\python.exe -u -m monkey_test --Event test_subprocess.py
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment