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
72190163
Commit
72190163
authored
Jun 03, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove test__socket debugging. It does seem that TravisCI uses large buffers by default.
parent
70c61625
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
gevent/_socket2.py
gevent/_socket2.py
+1
-4
greentest/test__socket.py
greentest/test__socket.py
+4
-5
No files found.
gevent/_socket2.py
View file @
72190163
...
...
@@ -291,17 +291,14 @@ class socket(object):
data_sent
=
0
while
data_sent
<
len
(
data
):
data_sent
+=
self
.
send
(
_get_memory
(
data
,
data_sent
),
flags
)
return
data_sent
,
'no timeout'
else
:
timeleft
=
self
.
timeout
end
=
time
.
time
()
+
timeleft
data_sent
=
0
trips
=
0
while
True
:
trips
+=
1
data_sent
+=
self
.
send
(
_get_memory
(
data
,
data_sent
),
flags
,
timeout
=
timeleft
)
if
data_sent
>=
len
(
data
):
return
data_sent
,
'timeout'
,
self
.
timeout
,
trips
return
timeleft
=
end
-
time
.
time
()
if
timeleft
<=
0
:
raise
timeout
(
'timed out'
)
...
...
greentest/test__socket.py
View file @
72190163
...
...
@@ -147,6 +147,9 @@ class TestTCP(greentest.TestCase):
if
sys
.
platform
!=
'win32'
:
def
test_sendall_timeout
(
self
):
# Travis-CI container infrastructure is configured with
# large socket buffers, at least 2MB, as-of Jun 3, 2015,
# so we must be sure to send more data than that.
data_sent
=
b'hello'
*
1000000
client_sock
=
[]
acceptor
=
Thread
(
target
=
lambda
:
client_sock
.
append
(
self
.
listener
.
accept
()))
...
...
@@ -156,11 +159,7 @@ class TestTCP(greentest.TestCase):
client
.
settimeout
(
0.1
)
start
=
time
.
time
()
try
:
count
=
client
.
sendall
(
data_sent
)
print
(
"Sent %s data in %s"
%
(
count
,
time
.
time
()
-
start
))
#self.assertRaises(self.TIMEOUT_ERROR, client.sendall, data_sent)
self
.
fail
(
"Should raise timeout error"
)
except
self
.
TIMEOUT_ERROR
:
self
.
assertRaises
(
self
.
TIMEOUT_ERROR
,
client
.
sendall
,
data_sent
)
took
=
time
.
time
()
-
start
assert
0.1
-
0.01
<=
took
<=
0.1
+
0.1
,
took
finally
:
...
...
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