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
b99bba82
Commit
b99bba82
authored
Feb 28, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase some test server timeouts for appveyor.
parent
ceec4406
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
greentest/test__example_echoserver.py
greentest/test__example_echoserver.py
+1
-1
greentest/test__server.py
greentest/test__server.py
+8
-4
No files found.
greentest/test__example_echoserver.py
View file @
b99bba82
...
...
@@ -16,7 +16,7 @@ class Test(util.TestServer):
kwargs
=
{
'bufsize'
:
1
}
kwargs
[
'mode'
]
=
'rb'
conn
=
create_connection
((
'127.0.0.1'
,
16000
))
conn
.
settimeout
(
0.1
if
not
greentest
.
RUNNING_ON_APPVEYOR
else
1
.0
)
conn
.
settimeout
(
0.1
if
not
greentest
.
RUNNING_ON_APPVEYOR
else
2
.0
)
rfile
=
conn
.
makefile
(
**
kwargs
)
welcome
=
rfile
.
readline
()
...
...
greentest/test__server.py
View file @
b99bba82
...
...
@@ -7,6 +7,10 @@ from gevent.server import StreamServer
import
errno
import
os
# Timeouts very flaky on appveyor
_DEFAULT_SOCKET_TIMEOUT
=
0.1
if
not
greentest
.
RUNNING_ON_APPVEYOR
else
1.0
_DEFAULT_TEST_TIMEOUT
=
5
if
not
greentest
.
RUNNING_ON_APPVEYOR
else
10
class
SimpleStreamServer
(
StreamServer
):
...
...
@@ -67,7 +71,7 @@ class Settings:
class
TestCase
(
greentest
.
TestCase
):
__timeout__
=
5
__timeout__
=
_DEFAULT_TEST_TIMEOUT
def
cleanup
(
self
):
if
getattr
(
self
,
'server'
,
None
)
is
not
None
:
...
...
@@ -80,7 +84,7 @@ class TestCase(greentest.TestCase):
sock
.
listen
(
5
)
return
sock
def
makefile
(
self
,
timeout
=
0.1
,
bufsize
=
1
):
def
makefile
(
self
,
timeout
=
_DEFAULT_SOCKET_TIMEOUT
,
bufsize
=
1
):
sock
=
socket
.
socket
()
try
:
sock
.
connect
((
self
.
server
.
server_host
,
self
.
server
.
server_port
))
...
...
@@ -103,7 +107,7 @@ class TestCase(greentest.TestCase):
sock
.
close
()
return
rconn
def
send_request
(
self
,
url
=
'/'
,
timeout
=
0.1
,
bufsize
=
1
):
def
send_request
(
self
,
url
=
'/'
,
timeout
=
_DEFAULT_SOCKET_TIMEOUT
,
bufsize
=
1
):
conn
=
self
.
makefile
(
timeout
=
timeout
,
bufsize
=
bufsize
)
conn
.
write
((
'GET %s HTTP/1.0
\
r
\
n
\
r
\
n
'
%
url
).
encode
(
'latin-1'
))
conn
.
flush
()
...
...
@@ -149,7 +153,7 @@ class TestCase(greentest.TestCase):
assert
result
.
startswith
(
'HTTP/1.0 500 Internal Server Error'
),
repr
(
result
)
conn
.
close
()
def
assertRequestSucceeded
(
self
,
timeout
=
0.1
):
def
assertRequestSucceeded
(
self
,
timeout
=
_DEFAULT_SOCKET_TIMEOUT
):
conn
=
self
.
makefile
(
timeout
=
timeout
)
conn
.
write
(
b'GET /ping HTTP/1.0
\
r
\
n
\
r
\
n
'
)
result
=
conn
.
read
()
...
...
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