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
83b8e650
Commit
83b8e650
authored
Jan 09, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More libuv test adaptations.
parent
c468ab9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
src/greentest/greentest.py
src/greentest/greentest.py
+5
-0
src/greentest/test__socket_close.py
src/greentest/test__socket_close.py
+3
-0
src/greentest/test__systemerror.py
src/greentest/test__systemerror.py
+9
-7
No files found.
src/greentest/greentest.py
View file @
83b8e650
...
...
@@ -157,6 +157,11 @@ if LIBUV:
else
:
skipOnLibuv
=
_do_not_skip
if
LIBUV
and
RUNNING_ON_CI
:
skipOnLibuvOnCI
=
unittest
.
skip
else
:
skipOnLibuvOnCI
=
_do_not_skip
class
ExpectedException
(
Exception
):
"""An exception whose traceback should be ignored by the hub"""
...
...
src/greentest/test__socket_close.py
View file @
83b8e650
...
...
@@ -38,6 +38,9 @@ class Test(greentest.TestCase):
finally
:
receiver
.
kill
()
# XXX: This is possibly due to the bad behaviour of small sleeps?
# The timeout is the global test timeout, 10s
@
greentest
.
skipOnLibuvOnCI
(
"Sometimes randomly times out"
)
def
test_recv_twice
(
self
):
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
sock
.
connect
((
'localhost'
,
self
.
server
.
server_port
))
...
...
src/greentest/test__systemerror.py
View file @
83b8e650
...
...
@@ -57,16 +57,18 @@ class Test(greentest.TestCase):
def
test_system_error
(
self
):
self
.
start
(
raise_
,
SystemError
(
MSG
))
try
:
gevent
.
sleep
(
0.001
)
except
SystemError
as
ex
:
assert
str
(
ex
)
==
MSG
,
repr
(
str
(
ex
))
else
:
raise
AssertionError
(
'must raise SystemError'
)
with
self
.
assertRaisesRegex
(
SystemError
,
MSG
):
gevent
.
sleep
(
0.002
)
def
test_exception
(
self
):
self
.
start
(
raise_
,
Exception
(
'regular exception must not kill the program'
))
gevent
.
sleep
(
0.001
)
# XXX: libuv: libuv only allows a 0.001 minimum sleep time argument.
# If we pass that, sometimes TestCallback finds that the callback has not run
# when it tries to tearDown the test. Doubling that actually lets the callback run.
# So there's some interaction with minimum timers and the callback timer (?) which
# uses a timer of 0, asking to be run immediately on the next loop.
gevent
.
sleep
(
0.002
)
class
TestCallback
(
Test
):
...
...
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