Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
7b8de66f
Commit
7b8de66f
authored
Nov 10, 2017
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to fix the travis server errors.
parent
98c2c15f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
src/greentest/greentest.py
src/greentest/greentest.py
+12
-0
src/greentest/test__server.py
src/greentest/test__server.py
+5
-2
src/greentest/test__socket.py
src/greentest/test__socket.py
+2
-2
No files found.
src/greentest/greentest.py
View file @
7b8de66f
...
...
@@ -369,6 +369,18 @@ if PY3 and PYPY:
CI_TIMEOUT
=
10
LOCAL_TIMEOUT
=
1
DEFAULT_LOCAL_HOST_ADDR
=
'localhost'
DEFAULT_LOCAL_HOST_ADDR6
=
DEFAULT_LOCAL_HOST_ADDR
if
RUNNING_ON_TRAVIS
:
# As of November 2017 (probably Sept or Oct), after a
# Travis upgrade, using "localhost" no longer works,
# producing 'OSError: [Errno 99] Cannot assign
# requested address'. This is apparently something to do with
# docker containers. Sigh.
DEFAULT_LOCAL_HOST_ADDR
=
'127.0.0.1'
DEFAULT_LOCAL_HOST_ADDR6
=
'::1'
class
TestCase
(
TestCaseMetaClass
(
"NewBase"
,
(
BaseTestCase
,),
{})):
__timeout__
=
LOCAL_TIMEOUT
if
not
RUNNING_ON_CI
else
CI_TIMEOUT
switch_expected
=
'default'
...
...
src/greentest/test__server.py
View file @
7b8de66f
...
...
@@ -86,8 +86,11 @@ class TestCase(greentest.TestCase):
def
get_server_host_port_family
(
self
):
server_host
=
self
.
server
.
server_host
if
not
server_host
or
server_host
==
'::'
:
server_host
=
'localhost'
if
not
server_host
:
server_host
=
greentest
.
DEFAULT_LOCAL_HOST_ADDR
elif
server_host
==
'::'
:
server_host
=
greentest
.
DEFAULT_LOCAL_HOST_ADDR6
try
:
family
=
self
.
server
.
socket
.
family
except
AttributeError
:
...
...
src/greentest/test__socket.py
View file @
7b8de66f
...
...
@@ -267,7 +267,7 @@ class TestTCP(greentest.TestCase):
# Issue 841
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
setblocking
(
False
)
ret
=
s
.
connect_ex
((
'localhost'
,
get_port
()))
ret
=
s
.
connect_ex
((
greentest
.
DEFAULT_LOCAL_HOST_ADDR
,
get_port
()))
self
.
assertIsInstance
(
ret
,
errno_types
)
s
.
close
()
...
...
@@ -283,7 +283,7 @@ class TestTCP(greentest.TestCase):
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
setblocking
(
False
)
with
self
.
assertRaises
(
OverflowError
):
s
.
connect_ex
((
'localhost'
,
65539
))
s
.
connect_ex
((
greentest
.
DEFAULT_LOCAL_HOST_ADDR
,
65539
))
s
.
close
()
@
unittest
.
skipUnless
(
hasattr
(
socket
,
'SOCK_CLOEXEC'
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment