The agent keeps a reference to an instrumented function that prevents it from being garbage collected
@apotterri 已经在做这个了。
开始于 2024年5月24日。
评估
这个 Issue 还没有评估数据。
描述
https://github.com/pallets/flask
============================================================== FAILURES ==============================================================
__________________________________________________ test_app_freed_on_zero_refcount ___________________________________________________
@require_cpython_gc
def test_app_freed_on_zero_refcount():
# A Flask instance should not create a reference cycle that prevents CPython
# from freeing it when all external references to it are released (see #3761).
gc.disable()
try:
app = flask.Flask(__name__)
assert app.view_functions["static"]
weak = weakref.ref(app)
assert weak() is not None
del app
> assert weak() is None
E AssertionError: assert <Flask 'test_basic'> is None
E + where <Flask 'test_basic'> = <weakref at 0x11b897b50; to 'Flask' at 0x11bcc5150>()
tests/test_basic.py:1888: AssertionError
--------------------------------------------------------- Captured log call ----------------------------------------------------------
INFO _appmap.recording:recording.py:77 writing /Users/kgilpin/source/land-of-apps/pallets-flask/tmp/appmap/pytest/test_app_freed_on_zero_refcount.appmap.json
========================================================== warnings summary ==========================================================
venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:274
/Users/kgilpin/source/land-of-apps/pallets-flask/venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:274: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: _appmap
self.config.issue_config_time_warning(
venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:274
/Users/kgilpin/source/land-of-apps/pallets-flask/venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:274: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: appmap
self.config.issue_config_time_warning(
tests/test_basic.py::test_server_name_subdomain
/Users/kgilpin/source/land-of-apps/pallets-flask/venv/lib/python3.10/site-packages/_appmap/instrument.py:92: UserWarning: Current server name 'foo.localhost' doesn't match configured server name 'dev.local'
ret = f.fn(*args, **kwargs)
tests/test_basic.py::test_subdomain_matching_other_name[False]
tests/test_basic.py::test_subdomain_matching_other_name[True]
/Users/kgilpin/source/land-of-apps/pallets-flask/venv/lib/python3.10/site-packages/_appmap/instrument.py:92: UserWarning: Current server name '127.0.0.1:3000' doesn't match configured server name 'localhost.localdomain:3000'
ret = f.fn(*args, **kwargs)
tests/test_reqctx.py::test_proper_test_request_context
/Users/kgilpin/source/land-of-apps/pallets-flask/venv/lib/python3.10/site-packages/_appmap/instrument.py:92: UserWarning: Current server name 'localhost' doesn't match configured server name 'localhost.localdomain:5000'
ret = f.fn(*args, **kwargs)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================== short test summary info =======================================================
FAILED tests/test_basic.py::test_app_freed_on_zero_refcount - AssertionError: assert <Flask 'test_basic'> is None
================================== 1 failed, 469 passed, 7 skipped, 6 warnings in 85.70s (0:01:25) ===================================
- 主要语言
- Python
- 星标
- 104
- 派生
- 17
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getappmap/appmap-python 的其他 Issue
-
getappmap/appmap-python#381 · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 35/100
getappmap/appmap-python#376 ·
-
难度 4/5 3-5 天 新手友好度 35/100
getappmap/appmap-python#371 ·
-
enhancement navie-plan
getappmap/appmap-python#366 · 1 条评论 · 已指派 1 人 ·
-
navie-plan
难度 4/5 3-5 天 新手友好度 35/100
getappmap/appmap-python#365 · 1 条评论 ·
查看 getappmap/appmap-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
难度 2/5 1-3 小时 新手友好度 88/100
OpenHands/extensions#626 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
CSCfi/sd-search-api#39 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 68/100
StevenBlack/hosts#3255 ·