@@ -124,11 +124,11 @@ def test_transaction_max_span_dropped_statistics_not_collected_for_incompatible_
124
124
@pytest .mark .parametrize ("elasticapm_client" , [{"exit_span_min_duration" : "1ms" }], indirect = True )
125
125
def test_transaction_fast_exit_span (elasticapm_client ):
126
126
elasticapm_client .begin_transaction ("test_type" )
127
- with elasticapm .capture_span (span_type = "x" , name = "x" , leaf = True , duration = 2 ): # not dropped, too long
127
+ with elasticapm .capture_span (span_type = "x" , name = "x" , leaf = True , duration = 0.002 ): # not dropped, too long
128
128
pass
129
- with elasticapm .capture_span (span_type = "y" , name = "y" , leaf = True , duration = 0.1 ): # dropped
129
+ with elasticapm .capture_span (span_type = "y" , name = "y" , leaf = True , duration = 0.0001 ): # dropped
130
130
pass
131
- with elasticapm .capture_span (span_type = "z" , name = "z" , leaf = False , duration = 0.1 ): # not dropped, not exit
131
+ with elasticapm .capture_span (span_type = "z" , name = "z" , leaf = False , duration = 0.0001 ): # not dropped, not exit
132
132
pass
133
133
elasticapm_client .end_transaction ("foo" , duration = 2.2 )
134
134
transaction = elasticapm_client .events [constants .TRANSACTION ][0 ]
@@ -139,6 +139,6 @@ def test_transaction_fast_exit_span(elasticapm_client):
139
139
assert transaction ["span_count" ]["started" ] == 3
140
140
assert transaction ["span_count" ]["dropped" ] == 1
141
141
assert metrics [0 ]["span" ]["type" ] == "x"
142
- assert metrics [0 ]["samples" ]["span.self_time.sum.us" ]["value" ] == 2000000
142
+ assert metrics [0 ]["samples" ]["span.self_time.sum.us" ]["value" ] == 2000
143
143
assert metrics [1 ]["span" ]["type" ] == "y"
144
- assert metrics [1 ]["samples" ]["span.self_time.sum.us" ]["value" ] == 100000
144
+ assert metrics [1 ]["samples" ]["span.self_time.sum.us" ]["value" ] == 100
0 commit comments