Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e4059462
Commit
e4059462
authored
Mar 31, 2013
by
Charles-Francois Natali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #6419: Fix a test_kqueue failure on some BSD flavors.
parent
56bb8b9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
22 deletions
+13
-22
Lib/test/test_kqueue.py
Lib/test/test_kqueue.py
+13
-22
No files found.
Lib/test/test_kqueue.py
View file @
e4059462
...
...
@@ -96,11 +96,6 @@ class TestKQueue(unittest.TestCase):
pass
# FreeBSD doesn't raise an exception here
server
,
addr
=
serverSocket
.
accept
()
if
sys
.
platform
.
startswith
(
"darwin"
):
flags
=
select
.
KQ_EV_ADD
|
select
.
KQ_EV_ENABLE
else
:
flags
=
0
kq
=
select
.
kqueue
()
kq2
=
select
.
kqueue
.
fromfd
(
kq
.
fileno
())
...
...
@@ -122,11 +117,10 @@ class TestKQueue(unittest.TestCase):
kq2
.
control
([
ev
],
0
)
events
=
kq
.
control
(
None
,
4
,
1
)
events
=
[(
e
.
ident
,
e
.
filter
,
e
.
flags
)
for
e
in
events
]
events
.
sort
()
self
.
assertEqual
(
events
,
[
(
client
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
),
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
)])
events
=
set
((
e
.
ident
,
e
.
filter
)
for
e
in
events
)
self
.
assertEqual
(
events
,
set
([
(
client
.
fileno
(),
select
.
KQ_FILTER_WRITE
),
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
)]))
client
.
send
(
"Hello!"
)
server
.
send
(
"world!!!"
)
...
...
@@ -140,14 +134,12 @@ class TestKQueue(unittest.TestCase):
else
:
self
.
fail
(
'timeout waiting for event notifications'
)
events
=
[(
e
.
ident
,
e
.
filter
,
e
.
flags
)
for
e
in
events
]
events
.
sort
()
self
.
assertEqual
(
events
,
[
(
client
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
),
(
client
.
fileno
(),
select
.
KQ_FILTER_READ
,
flags
),
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
),
(
server
.
fileno
(),
select
.
KQ_FILTER_READ
,
flags
)])
events
=
set
((
e
.
ident
,
e
.
filter
)
for
e
in
events
)
self
.
assertEqual
(
events
,
set
([
(
client
.
fileno
(),
select
.
KQ_FILTER_WRITE
),
(
client
.
fileno
(),
select
.
KQ_FILTER_READ
),
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
),
(
server
.
fileno
(),
select
.
KQ_FILTER_READ
)]))
# Remove completely client, and server read part
ev
=
select
.
kevent
(
client
.
fileno
(),
...
...
@@ -164,10 +156,9 @@ class TestKQueue(unittest.TestCase):
kq
.
control
([
ev
],
0
,
0
)
events
=
kq
.
control
([],
4
,
0.99
)
events
=
[(
e
.
ident
,
e
.
filter
,
e
.
flags
)
for
e
in
events
]
events
.
sort
()
self
.
assertEqual
(
events
,
[
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
,
flags
)])
events
=
set
((
e
.
ident
,
e
.
filter
)
for
e
in
events
)
self
.
assertEqual
(
events
,
set
([
(
server
.
fileno
(),
select
.
KQ_FILTER_WRITE
)]))
client
.
close
()
server
.
close
()
...
...
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