Title: in-process invocation of a test runner fails with "Recording already in progress" · Issue #371 · getappmap/appmap-python · GitHub
Open Graph Title: in-process invocation of a test runner fails with "Recording already in progress" · Issue #371 · getappmap/appmap-python
X Title: in-process invocation of a test runner fails with "Recording already in progress" · Issue #371 · getappmap/appmap-python
Description: 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...
Open Graph Description: 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 s...
X Description: 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 s...
Opengraph URL: https://github.com/getappmap/appmap-python/issues/371
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"in-process invocation of a test runner fails with \"Recording already in progress\"","articleBody":"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. \r\n\r\nFor example, in [this test](https://github.com/TobikoData/sqlmesh/blob/aa7f7e42005c7f3a699c9647c99422b99a92a033/tests/cli/test_cli.py#L165), the `sqlmesh plan` subcommand uses a [click.testing.CliRunner](https://click.palletsprojects.com/en/8.1.x/api/#click.testing.CliRunner) to run a unittest test, which fails:\r\n\r\n```\r\ntests/cli/test_cli.py::test_plan \r\n----------------------------------------------------------------------\r\nTest Failure Summary\r\n======================================================================\r\nNum Successful Tests: 0\r\nFailure Test: sqlmesh_example.full_model test_example_full_model\r\n======================================================================\r\nE\r\n======================================================================\r\nERROR: test_example_full_model (/private/var/folders/2g/xqtf8_tn5j1861bbkvvhtmmr0000gn/T/pytest-of-ajp/pytest-159/test_plan0/tests/test_full_model.yaml)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n File \"/Users/ajp/src/applandinc/appmap-python/_appmap/wrapt/wrappers.py\", line 744, in __call__\r\n return self._self_wrapper(self.__wrapped__, self._self_instance,\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/ajp/src/applandinc/appmap-python/_appmap/unittest.py\", line 36, in callTestMethod\r\n with _session.record(test_case.__class__, method_name, location=location) as metadata:\r\n File \"/Users/ajp/.asdf/installs/python/3.12.2/lib/python3.12/contextlib.py\", line 137, in __enter__\r\n return next(self.gen)\r\n ^^^^^^^^^^^^^^\r\n File \"/Users/ajp/src/applandinc/appmap-python/_appmap/testing_framework.py\", line 119, in record\r\n with rec, environ.disabled(\"requests\"):\r\n File \"/Users/ajp/src/applandinc/appmap-python/_appmap/recording.py\", line 47, in __enter__\r\n self.start()\r\n File \"/Users/ajp/src/applandinc/appmap-python/_appmap/recording.py\", line 32, in start\r\n r.start_recording()\r\n File \"/Users/ajp/src/applandinc/appmap-python/_appmap/recorder.py\", line 108, in start_recording\r\n cls.get_current()._start_recording() # pylint: disable=protected-access\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/Users/ajp/src/applandinc/appmap-python/_appmap/recorder.py\", line 236, in _start_recording\r\n super()._start_recording()\r\n File \"/Users/ajp/src/applandinc/appmap-python/_appmap/recorder.py\", line 158, in _start_recording\r\n raise RuntimeError(\"Recording already in progress\")\r\nRuntimeError: Recording already in progress\r\n\r\n----------------------------------------------------------------------\r\nRan 1 test in 0.165s\r\n\r\nFAILED (errors=1)\r\n\r\nError: Cannot generate plan due to failing test(s). Fix test(s) and run again\r\n\r\nFAILED\r\n\r\n============================================================================================ FAILURES ============================================================================================\r\n```","author":{"url":"https://github.com/apotterri","@type":"Person","name":"apotterri"},"datePublished":"2024-08-16T12:45:18Z","url":"https://github.com/getappmap/appmap-python/issues/371"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a5baa2e7-7cbc-ad77-4367-0a80349fc109 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC54:3DCCC3:329D825:4303980:6B0360AF |
| html-safe-nonce | d412a7ba051a33a01537315e49d6f95a33a55e4a69e0786a6287d1fc7211aa3e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzU0OjNEQ0NDMzozMjlEODI1OjQzMDM5ODA6NkIwMzYwQUYiLCJ2aXNpdG9yX2lkIjoiMzM5MDkwNDM5MzExNjM3NzI2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | eee21b39c98d5e28ddc99f0d66ba319f8ae67dcf723a6f8d0675720557489ba7 |
| hovercard-subject-tag | issue:2470207447 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getappmap/appmap-python/371/issue_layout |
| twitter:image | https://opengraph.githubassets.com/643c5bb17d51b430ae90ccf7b2da9405513fc95c75a02fb04aa18df4378aebb6/getappmap/appmap-python/issues/371 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/643c5bb17d51b430ae90ccf7b2da9405513fc95c75a02fb04aa18df4378aebb6/getappmap/appmap-python/issues/371 |
| og:image:alt | 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 s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | apotterri |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getappmap/appmap-python git https://github.com/getappmap/appmap-python.git |
| octolytics-dimension-user_id | 46610017 |
| octolytics-dimension-user_login | getappmap |
| octolytics-dimension-repository_id | 314785884 |
| octolytics-dimension-repository_nwo | getappmap/appmap-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 314785884 |
| octolytics-dimension-repository_network_root_nwo | getappmap/appmap-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width