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
8b5206ed
Commit
8b5206ed
authored
Jan 24, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Capture another flaky test
parent
4a00f998
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
src/greentest/test__greenletset.py
src/greentest/test__greenletset.py
+14
-10
No files found.
src/greentest/test__greenletset.py
View file @
8b5206ed
import
time
import
greentest
from
greentest.flaky
import
reraiseFlakyTestRaceConditionLibuv
import
gevent
from
gevent
import
pool
from
gevent.timeout
import
Timeout
...
...
@@ -32,13 +33,16 @@ class Test(greentest.TestCase):
DELAY
=
0.05
if
not
greentest
.
RUNNING_ON_APPVEYOR
else
0.1
s
=
pool
.
Group
()
s
.
spawn
(
gevent
.
sleep
,
DELAY
)
assert
len
(
s
)
==
1
,
s
self
.
assertEqual
(
len
(
s
),
1
,
s
)
s
.
spawn
(
gevent
.
sleep
,
DELAY
*
2.
)
assert
len
(
s
)
==
2
,
s
self
.
assertEqual
(
len
(
s
),
2
,
s
)
gevent
.
sleep
(
DELAY
*
3.
/
2.
)
assert
len
(
s
)
==
1
,
s
try
:
self
.
assertEqual
(
len
(
s
),
1
,
s
)
except
AssertionError
:
reraiseFlakyTestRaceConditionLibuv
()
gevent
.
sleep
(
DELAY
)
assert
not
s
,
s
self
.
assertFalse
(
s
)
def
test_waitall
(
self
):
s
=
pool
.
Group
()
...
...
@@ -48,8 +52,8 @@ class Test(greentest.TestCase):
start
=
time
.
time
()
s
.
join
(
raise_error
=
True
)
delta
=
time
.
time
()
-
start
assert
not
s
,
s
assert
len
(
s
)
==
0
,
s
self
.
assertFalse
(
s
)
self
.
assertEqual
(
len
(
s
),
0
)
self
.
assertTimeWithinRange
(
delta
,
DELAY
*
1.9
,
DELAY
*
2.5
)
def
test_kill_block
(
self
):
...
...
@@ -59,8 +63,8 @@ class Test(greentest.TestCase):
assert
len
(
s
)
==
2
,
s
start
=
time
.
time
()
s
.
kill
()
assert
not
s
,
s
assert
len
(
s
)
==
0
,
s
self
.
assertFalse
(
s
)
self
.
assertEqual
(
len
(
s
),
0
)
delta
=
time
.
time
()
-
start
assert
delta
<
DELAY
*
0.8
,
delta
...
...
@@ -72,8 +76,8 @@ class Test(greentest.TestCase):
s
.
kill
(
block
=
False
)
assert
len
(
s
)
==
2
,
s
gevent
.
sleep
(
0.0001
)
assert
len
(
s
)
==
0
,
s
assert
not
s
,
s
self
.
assertFalse
(
s
)
self
.
assertEqual
(
len
(
s
),
0
)
def
test_kill_fires_once
(
self
):
u1
=
Undead
()
...
...
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