Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
110e6c12
Unverified
Commit
110e6c12
authored
Aug 20, 2020
by
Henry Schreiner
Committed by
GitHub
Aug 20, 2020
Browse files
ci: reduce flakiness a little (#2418)
parent
24dffe46
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
tests/env.py
tests/env.py
+2
-0
tests/test_gil_scoped.py
tests/test_gil_scoped.py
+9
-0
No files found.
tests/env.py
View file @
110e6c12
...
@@ -10,3 +10,5 @@ CPYTHON = platform.python_implementation() == "CPython"
...
@@ -10,3 +10,5 @@ CPYTHON = platform.python_implementation() == "CPython"
PYPY
=
platform
.
python_implementation
()
==
"PyPy"
PYPY
=
platform
.
python_implementation
()
==
"PyPy"
PY2
=
sys
.
version_info
.
major
==
2
PY2
=
sys
.
version_info
.
major
==
2
PY
=
sys
.
version_info
tests/test_gil_scoped.py
View file @
110e6c12
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import
multiprocessing
import
multiprocessing
import
threading
import
threading
import
pytest
import
env
# noqa: F401
from
pybind11_tests
import
gil_scoped
as
m
from
pybind11_tests
import
gil_scoped
as
m
...
@@ -57,6 +62,8 @@ def test_python_to_cpp_to_python_from_thread():
...
@@ -57,6 +62,8 @@ def test_python_to_cpp_to_python_from_thread():
assert
_run_in_process
(
_python_to_cpp_to_python_from_threads
,
1
)
==
0
assert
_run_in_process
(
_python_to_cpp_to_python_from_threads
,
1
)
==
0
# TODO: FIXME
@
pytest
.
mark
.
xfail
(
"env.PY > (3,8) and env.MACOS"
,
strict
=
False
)
def
test_python_to_cpp_to_python_from_thread_multiple_parallel
():
def
test_python_to_cpp_to_python_from_thread_multiple_parallel
():
"""Makes sure there is no GIL deadlock when running in a thread multiple times in parallel.
"""Makes sure there is no GIL deadlock when running in a thread multiple times in parallel.
...
@@ -73,6 +80,8 @@ def test_python_to_cpp_to_python_from_thread_multiple_sequential():
...
@@ -73,6 +80,8 @@ def test_python_to_cpp_to_python_from_thread_multiple_sequential():
assert
_run_in_process
(
_python_to_cpp_to_python_from_threads
,
8
,
parallel
=
False
)
==
0
assert
_run_in_process
(
_python_to_cpp_to_python_from_threads
,
8
,
parallel
=
False
)
==
0
# TODO: FIXME
@
pytest
.
mark
.
xfail
(
"env.PY > (3,8) and env.MACOS"
,
strict
=
False
)
def
test_python_to_cpp_to_python_from_process
():
def
test_python_to_cpp_to_python_from_process
():
"""Makes sure there is no GIL deadlock when using processes.
"""Makes sure there is no GIL deadlock when using processes.
...
...
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