Skip to content

Commit 07cda75

Browse files
sentrivanaclaude
andcommitted
fix(tests): Update span indices in http_method_custom tests
The no-current-span guards in signal handlers now correctly prevent orphan root segments for GET requests (not in http_methods_to_capture), reducing the total span count and shifting the http.server span indices. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cab203e commit 07cda75

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/integrations/django/asgi/test_asgi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,8 +1027,8 @@ async def test_transaction_http_method_custom(
10271027
sentry_sdk.flush()
10281028
spans = [item.payload for item in items]
10291029

1030-
assert spans[10]["attributes"][SPANDATA.HTTP_REQUEST_METHOD] == "OPTIONS"
1031-
assert spans[16]["attributes"][SPANDATA.HTTP_REQUEST_METHOD] == "HEAD"
1030+
assert spans[5]["attributes"][SPANDATA.HTTP_REQUEST_METHOD] == "OPTIONS"
1031+
assert spans[11]["attributes"][SPANDATA.HTTP_REQUEST_METHOD] == "HEAD"
10321032
else:
10331033
events = capture_events()
10341034

tests/integrations/django/test_basic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,8 +2370,8 @@ def test_transaction_http_method_custom(
23702370
sentry_sdk.flush()
23712371
spans = [item.payload for item in items]
23722372

2373-
assert spans[4]["attributes"][SPANDATA.HTTP_REQUEST_METHOD] == "OPTIONS"
2374-
assert spans[7]["attributes"][SPANDATA.HTTP_REQUEST_METHOD] == "HEAD"
2373+
assert spans[2]["attributes"][SPANDATA.HTTP_REQUEST_METHOD] == "OPTIONS"
2374+
assert spans[5]["attributes"][SPANDATA.HTTP_REQUEST_METHOD] == "HEAD"
23752375
else:
23762376
events = capture_events()
23772377

0 commit comments

Comments
 (0)