Skip to content

Commit b15b7b0

Browse files
adjust outgoing trace test
1 parent debbdda commit b15b7b0

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

tests/integrations/stdlib/test_httplib.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,17 @@ def getresponse(self, *args, **kwargs):
192192
if span_streaming:
193193
items = capture_items("span")
194194

195+
sentry_sdk.traces.continue_trace({})
196+
195197
with mock.patch(
196198
"sentry_sdk.tracing_utils.Random.randrange", return_value=250000
197199
):
198-
sentry_sdk.traces.continue_trace({})
199-
200-
with sentry_sdk.traces.start_span(name="Head SDK tx"):
201-
connection = HTTPSConnectionRecordingRequestHeaders("localhost", port=PORT)
202-
connection.request("GET", "/top-chasers")
203-
connection.getresponse()
200+
with sentry_sdk.traces.start_span(name="Head SDK tx"):
201+
connection = HTTPSConnectionRecordingRequestHeaders(
202+
"localhost", port=PORT
203+
)
204+
connection.request("GET", "/top-chasers")
205+
connection.getresponse()
204206

205207
sentry_sdk.flush()
206208
request_span = next(item.payload for item in items if item.type == "span")
@@ -215,8 +217,9 @@ def getresponse(self, *args, **kwargs):
215217
"sentry-sample_rand=0.250000,"
216218
"sentry-environment=production,"
217219
"sentry-release=foo,"
220+
"sentry-transaction=Head%%20SDK%%20tx,"
218221
"sentry-sample_rate=0.5,"
219-
"sentry-sampled=%s"
222+
"sentry-sampled=true"
220223
) % request_span["trace_id"]
221224
else:
222225
events = capture_events()

0 commit comments

Comments
 (0)