in-process invocation of a test runner fails with "Recording already in progress"
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- devtools, testing-qa
調査の方向性
tests/cli/test_cli.py::test_plan のテストから失敗を再現し、その後 _appmap/unittest.py、testing_framework.py、recording.py、recorder.py を通るネストされた記録フローを追跡します。プロセス内テストランナーで「Recording already in progress」が発生しなくなり、plan テストが正常に完了することを確認します。
索引モデルが issue の本文から書いたものです。
説明
If one of the supported test runners (e.g. pytest, unittest) is run in-process, the enabled recording methods for the process apply to the test runner.
For example, in this test, the sqlmesh plan subcommand uses a click.testing.CliRunner to run a unittest test, which fails:
tests/cli/test_cli.py::test_plan
----------------------------------------------------------------------
Test Failure Summary
======================================================================
Num Successful Tests: 0
Failure Test: sqlmesh_example.full_model test_example_full_model
======================================================================
E
======================================================================
ERROR: test_example_full_model (/private/var/folders/2g/xqtf8_tn5j1861bbkvvhtmmr0000gn/T/pytest-of-ajp/pytest-159/test_plan0/tests/test_full_model.yaml)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ajp/src/applandinc/appmap-python/_appmap/wrapt/wrappers.py", line 744, in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ajp/src/applandinc/appmap-python/_appmap/unittest.py", line 36, in callTestMethod
with _session.record(test_case.__class__, method_name, location=location) as metadata:
File "/Users/ajp/.asdf/installs/python/3.12.2/lib/python3.12/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/Users/ajp/src/applandinc/appmap-python/_appmap/testing_framework.py", line 119, in record
with rec, environ.disabled("requests"):
File "/Users/ajp/src/applandinc/appmap-python/_appmap/recording.py", line 47, in __enter__
self.start()
File "/Users/ajp/src/applandinc/appmap-python/_appmap/recording.py", line 32, in start
r.start_recording()
File "/Users/ajp/src/applandinc/appmap-python/_appmap/recorder.py", line 108, in start_recording
cls.get_current()._start_recording() # pylint: disable=protected-access
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ajp/src/applandinc/appmap-python/_appmap/recorder.py", line 236, in _start_recording
super()._start_recording()
File "/Users/ajp/src/applandinc/appmap-python/_appmap/recorder.py", line 158, in _start_recording
raise RuntimeError("Recording already in progress")
RuntimeError: Recording already in progress
----------------------------------------------------------------------
Ran 1 test in 0.165s
FAILED (errors=1)
Error: Cannot generate plan due to failing test(s). Fix test(s) and run again
FAILED
============================================================================================ FAILURES ============================================================================================
- 主要言語
- Python
- スター
- 104
- フォーク
- 17
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getappmap/appmap-python のほかの issue
-
getappmap/appmap-python#381 · 担当者 1 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
getappmap/appmap-python#376 ·
-
enhancement navie-plan
getappmap/appmap-python#366 · コメント 1 件 · 担当者 1 名 ·
-
navie-plan
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
getappmap/appmap-python#365 · コメント 1 件 ·
-
appmap-python
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
getappmap/appmap-python#362 ·
getappmap/appmap-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
zostera/django-bootstrap4#894 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3276 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#117848 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
zilliztech/memsearch#759 ·