@@ -37,7 +37,6 @@ def test_nested_wrap_handler(self):
3737 assert nested_span .duration >= 0.05
3838 assert request_span .get_tag ("component" ) == "tornado"
3939 assert request_span .get_tag ("span.kind" ) == "server"
40- assert nested_span .get_tag ("component" ) == "tornado"
4140
4241 def test_nested_exception_wrap_handler (self ):
4342 # it should trace a handler that calls a coroutine that raises an exception
@@ -70,16 +69,13 @@ def test_nested_exception_wrap_handler(self):
7069 assert nested_span .duration >= 0.05
7170 assert request_span .get_tag ("component" ) == "tornado"
7271 assert request_span .get_tag ("span.kind" ) == "server"
73- assert nested_span .get_tag ("component" ) == "tornado"
7472
7573 def test_sync_nested_wrap_handler (self ):
76- # it should trace a handler that calls a coroutine
7774 response = self .fetch ("/sync_nested_wrap/" )
7875 assert 200 == response .code
7976 traces = self .pop_traces ()
8077 assert 1 == len (traces )
8178 assert 2 == len (traces [0 ])
82- # check request span
8379 request_span = traces [0 ][0 ]
8480 assert "tornado-web" == request_span .service
8581 assert "tornado.request" == request_span .name
@@ -89,17 +85,14 @@ def test_sync_nested_wrap_handler(self):
8985 assert_span_http_status_code (request_span , 200 )
9086 assert self .get_url ("/sync_nested_wrap/" ) == request_span .get_tag (http .URL )
9187 assert 0 == request_span .error
92- # check nested span
9388 nested_span = traces [0 ][1 ]
9489 assert "tornado-web" == nested_span .service
9590 assert "tornado.func" == nested_span .name
9691 assert 0 == nested_span .error
97- # check durations because of the yield sleep
98- assert request_span .duration >= 0.05
92+ # Span duration includes async operation because wrap_executor waits for Future completion
9993 assert nested_span .duration >= 0.05
10094 assert request_span .get_tag ("component" ) == "tornado"
10195 assert request_span .get_tag ("span.kind" ) == "server"
102- assert nested_span .get_tag ("component" ) == "tornado"
10396
10497 def test_sync_nested_exception_wrap_handler (self ):
10598 # it should trace a handler that calls a coroutine that raises an exception
@@ -132,7 +125,6 @@ def test_sync_nested_exception_wrap_handler(self):
132125 assert nested_span .duration >= 0.05
133126 assert request_span .get_tag ("component" ) == "tornado"
134127 assert request_span .get_tag ("span.kind" ) == "server"
135- assert nested_span .get_tag ("component" ) == "tornado"
136128
137129 def test_nested_wrap_executor_handler (self ):
138130 # it should trace a handler that calls a blocking function in a different executor
@@ -161,7 +153,6 @@ def test_nested_wrap_executor_handler(self):
161153 assert nested_span .duration >= 0.05
162154 assert request_span .get_tag ("component" ) == "tornado"
163155 assert request_span .get_tag ("span.kind" ) == "server"
164- assert nested_span .get_tag ("component" ) == "tornado"
165156
166157 def test_nested_exception_wrap_executor_handler (self ):
167158 # it should trace a handler that calls a blocking function in a different
@@ -195,4 +186,3 @@ def test_nested_exception_wrap_executor_handler(self):
195186 assert nested_span .duration >= 0.05
196187 assert request_span .get_tag ("component" ) == "tornado"
197188 assert request_span .get_tag ("span.kind" ) == "server"
198- assert nested_span .get_tag ("component" ) == "tornado"
0 commit comments