@@ -303,15 +303,8 @@ def test_traceresponse_header(self):
303
303
self .seed_app (app )
304
304
self .send_default_request ()
305
305
306
- # traceresponse header corresponds to http.response.start span
307
- span = self .memory_exporter .get_finished_spans ()[1 ]
308
- self .assertDictEqual (
309
- dict (span .attributes ),
310
- {
311
- SpanAttributes .HTTP_STATUS_CODE : 200 ,
312
- "type" : "http.response.start" ,
313
- },
314
- )
306
+ span = self .memory_exporter .get_finished_spans ()[- 1 ]
307
+ self .assertEqual (trace_api .SpanKind .SERVER , span .kind )
315
308
316
309
response_start , response_body , * _ = self .get_all_output ()
317
310
self .assertEqual (response_body ["body" ], b"*" )
@@ -427,12 +420,8 @@ def test_websocket_traceresponse_header(self):
427
420
self .send_input ({"type" : "websocket.disconnect" })
428
421
_ , socket_send , * _ = self .get_all_output ()
429
422
430
- # traceresponse header corresponds to the 2nd websocket.send span
431
- span = self .memory_exporter .get_finished_spans ()[3 ]
432
- self .assertDictEqual (
433
- dict (span .attributes ),
434
- {SpanAttributes .HTTP_STATUS_CODE : 200 , "type" : "websocket.send" },
435
- )
423
+ span = self .memory_exporter .get_finished_spans ()[- 1 ]
424
+ self .assertEqual (trace_api .SpanKind .SERVER , span .kind )
436
425
437
426
traceresponse = "00-{0}-{1}-01" .format (
438
427
format_trace_id (span .get_span_context ().trace_id ),
0 commit comments