Skip to content

Cleanup meta references on flush #4420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: potel-base
Choose a base branch
from

Conversation

sl0thentr0py
Copy link
Member

No description provided.

@sl0thentr0py sl0thentr0py requested a review from a team as a code owner May 27, 2025 15:32
Copy link

codecov bot commented May 27, 2025

❌ 24 Tests Failed:

Tests completed Failed Passed Skipped
20567 24 20543 4417
View the top 3 failed test(s) by shortest run time
tests.integrations.aiohttp.test_aiohttp::test_crumb_capture_client_error[301-info]
Stack Traces | 0.002s run time
file .../integrations/aiohttp/test_aiohttp.py, line 539
  @pytest.mark.parametrize(
      "status_code,level",
      [
          (200, "info"),
          (301, "info"),
          (403, "warning"),
          (405, "warning"),
          (500, "error"),
      ],
  )
  @pytest.mark.asyncio
  async def test_crumb_capture_client_error(
      sentry_init,
      aiohttp_raw_server,
      aiohttp_client,
      event_loop,
      capture_events,
      status_code,
      level,
  ):
      sentry_init(integrations=[AioHttpIntegration()])

      async def handler(request):
          return web.Response(status=status_code)

      raw_server = await aiohttp_raw_server(handler)

      with start_span(name="crumbs"):
          events = capture_events()

          client = await aiohttp_client(raw_server)
          resp = await client.get("/")
          assert resp.status == status_code
          capture_message("Testing!")

          (event,) = events

          crumb = event["breadcrumbs"]["values"][0]
          assert crumb["type"] == "http"
          assert crumb["level"] == level
          assert crumb["category"] == "httplib"
          assert crumb["data"] == ApproxDict(
              {
                  "url": "http://127.0.0.1:{}/".format(raw_server.port),
                  "http.fragment": "",
                  "http.method": "GET",
                  "http.query": "",
                  "http.response.status_code": status_code,
              }
          )
E       fixture 'event_loop' not found
>       available fixtures: DictionaryContaining, ObjectDescribedBy, StringContaining, _capture_internal_warnings, _class_event_loop, _function_event_loop, _module_event_loop, _package_event_loop, _session_event_loop, aiohttp_client, aiohttp_client_cls, aiohttp_raw_server, aiohttp_server, benchmark, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capture_envelopes, capture_events, capture_events_forksafe, capture_exceptions, capture_record_lost_event_calls, clean_scopes, cov, doctest_namespace, event_loop_policy, httpserver, httpsserver, internal_exceptions, maybe_monkeypatched_threading, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, render_span_tree, reset_integrations, sentry_init, smtpserver, suppress_deprecation_warnings, teardown_profiling, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, uninstall_integration, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, validate_event_schema
>       use 'pytest --fixtures [testpath]' for help on them.

.../integrations/aiohttp/test_aiohttp.py:539
tests.integrations.aiohttp.test_aiohttp::test_crumb_capture_client_error[403-warning]
Stack Traces | 0.002s run time
file .../integrations/aiohttp/test_aiohttp.py, line 539
  @pytest.mark.parametrize(
      "status_code,level",
      [
          (200, "info"),
          (301, "info"),
          (403, "warning"),
          (405, "warning"),
          (500, "error"),
      ],
  )
  @pytest.mark.asyncio
  async def test_crumb_capture_client_error(
      sentry_init,
      aiohttp_raw_server,
      aiohttp_client,
      event_loop,
      capture_events,
      status_code,
      level,
  ):
      sentry_init(integrations=[AioHttpIntegration()])

      async def handler(request):
          return web.Response(status=status_code)

      raw_server = await aiohttp_raw_server(handler)

      with start_span(name="crumbs"):
          events = capture_events()

          client = await aiohttp_client(raw_server)
          resp = await client.get("/")
          assert resp.status == status_code
          capture_message("Testing!")

          (event,) = events

          crumb = event["breadcrumbs"]["values"][0]
          assert crumb["type"] == "http"
          assert crumb["level"] == level
          assert crumb["category"] == "httplib"
          assert crumb["data"] == ApproxDict(
              {
                  "url": "http://127.0.0.1:{}/".format(raw_server.port),
                  "http.fragment": "",
                  "http.method": "GET",
                  "http.query": "",
                  "http.response.status_code": status_code,
              }
          )
E       fixture 'event_loop' not found
>       available fixtures: DictionaryContaining, ObjectDescribedBy, StringContaining, _capture_internal_warnings, _class_event_loop, _function_event_loop, _module_event_loop, _package_event_loop, _session_event_loop, aiohttp_client, aiohttp_client_cls, aiohttp_raw_server, aiohttp_server, benchmark, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capture_envelopes, capture_events, capture_events_forksafe, capture_exceptions, capture_record_lost_event_calls, clean_scopes, cov, doctest_namespace, event_loop_policy, httpserver, httpsserver, internal_exceptions, maybe_monkeypatched_threading, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, render_span_tree, reset_integrations, sentry_init, smtpserver, suppress_deprecation_warnings, teardown_profiling, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, uninstall_integration, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, validate_event_schema
>       use 'pytest --fixtures [testpath]' for help on them.

.../integrations/aiohttp/test_aiohttp.py:539
tests.integrations.aiohttp.test_aiohttp::test_crumb_capture_client_error[500-error]
Stack Traces | 0.002s run time
file .../integrations/aiohttp/test_aiohttp.py, line 539
  @pytest.mark.parametrize(
      "status_code,level",
      [
          (200, "info"),
          (301, "info"),
          (403, "warning"),
          (405, "warning"),
          (500, "error"),
      ],
  )
  @pytest.mark.asyncio
  async def test_crumb_capture_client_error(
      sentry_init,
      aiohttp_raw_server,
      aiohttp_client,
      event_loop,
      capture_events,
      status_code,
      level,
  ):
      sentry_init(integrations=[AioHttpIntegration()])

      async def handler(request):
          return web.Response(status=status_code)

      raw_server = await aiohttp_raw_server(handler)

      with start_span(name="crumbs"):
          events = capture_events()

          client = await aiohttp_client(raw_server)
          resp = await client.get("/")
          assert resp.status == status_code
          capture_message("Testing!")

          (event,) = events

          crumb = event["breadcrumbs"]["values"][0]
          assert crumb["type"] == "http"
          assert crumb["level"] == level
          assert crumb["category"] == "httplib"
          assert crumb["data"] == ApproxDict(
              {
                  "url": "http://127.0.0.1:{}/".format(raw_server.port),
                  "http.fragment": "",
                  "http.method": "GET",
                  "http.query": "",
                  "http.response.status_code": status_code,
              }
          )
E       fixture 'event_loop' not found
>       available fixtures: DictionaryContaining, ObjectDescribedBy, StringContaining, _capture_internal_warnings, _class_event_loop, _function_event_loop, _module_event_loop, _package_event_loop, _session_event_loop, aiohttp_client, aiohttp_client_cls, aiohttp_raw_server, aiohttp_server, benchmark, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capture_envelopes, capture_events, capture_events_forksafe, capture_exceptions, capture_record_lost_event_calls, clean_scopes, cov, doctest_namespace, event_loop_policy, httpserver, httpsserver, internal_exceptions, maybe_monkeypatched_threading, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, render_span_tree, reset_integrations, sentry_init, smtpserver, suppress_deprecation_warnings, teardown_profiling, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, uninstall_integration, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, validate_event_schema
>       use 'pytest --fixtures [testpath]' for help on them.

.../integrations/aiohttp/test_aiohttp.py:539

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant