Skip to content

Commit 45960bf

Browse files
mergify[bot]jd
andauthored
test(profiling): disable uwsgi master+lazy app scenario on gevent (#4457) (#4459)
This test does not work anymore with greenlet 2. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> (cherry picked from commit fa4fb87) Co-authored-by: Julien Danjou <[email protected]>
1 parent a649188 commit 45960bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/profiling/test_uwsgi.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
if sys.version_info[:2] >= (3, 10) or sys.platform == "win32":
1919
pytestmark = pytest.mark.skip
2020

21+
TESTING_GEVENT = os.getenv("DD_PROFILE_TEST_GEVENT", False)
2122

2223
uwsgi_app = os.path.join(os.path.dirname(__file__), "uwsgi-app.py")
2324

@@ -98,6 +99,9 @@ def test_uwsgi_threads_processes_master(uwsgi, tmp_path, monkeypatch):
9899
utils.check_pprof_file("%s.%d.1" % (filename, pid))
99100

100101

102+
# This test fails with greenlet 2: the uwsgi.atexit function that is being called and run the profiler stop procedure is
103+
# interrupted randomly in the middle and has no time to flush out the profile.
104+
@pytest.mark.skipif(TESTING_GEVENT, reason="Test fails with greenlet 2")
101105
def test_uwsgi_threads_processes_master_lazy_apps(uwsgi, tmp_path, monkeypatch):
102106
filename = str(tmp_path / "uwsgi.pprof")
103107
monkeypatch.setenv("DD_PROFILING_OUTPUT_PPROF", filename)
@@ -142,6 +146,9 @@ def test_uwsgi_threads_processes_master_lazy_apps(uwsgi, tmp_path, monkeypatch):
142146
@pytest.mark.skipif(
143147
not (sys.version_info[0] >= 3 and sys.version_info[1] >= 7), reason="this test crashes on old Python versions"
144148
)
149+
# This test fails with greenlet 2: the uwsgi.atexit function that is being called and run the profiler stop procedure is
150+
# interrupted randomly in the middle and has no time to flush out the profile.
151+
@pytest.mark.skipif(TESTING_GEVENT, reason="Test fails with greenlet 2")
145152
def test_uwsgi_threads_processes_no_master_lazy_apps(uwsgi, tmp_path, monkeypatch):
146153
filename = str(tmp_path / "uwsgi.pprof")
147154
monkeypatch.setenv("DD_PROFILING_OUTPUT_PPROF", filename)

0 commit comments

Comments
 (0)