@@ -68,6 +68,7 @@ async def test_ping(instrument, elasticapm_client, redis_async_conn):
68
68
transaction = elasticapm_client .events [TRANSACTION ][0 ]
69
69
span = elasticapm_client .spans_for_transaction (transaction )[0 ]
70
70
assert span ["name" ] == "PING"
71
+ assert span ["duration" ] > 0.2 # sanity test to ensure we measure the actual call
71
72
72
73
73
74
@pytest .mark .integrationtest
@@ -92,6 +93,7 @@ async def test_pipeline(instrument, elasticapm_client, redis_async_conn):
92
93
"port" : int (os .environ .get ("REDIS_PORT" , 6379 )),
93
94
"service" : {"name" : "" , "resource" : "redis" , "type" : "" },
94
95
}
96
+ assert spans [0 ]["duration" ] > 0.2 # sanity test to ensure we measure the actual call
95
97
96
98
assert spans [1 ]["name" ] == "test_pipeline"
97
99
assert spans [1 ]["type" ] == "test"
@@ -123,6 +125,7 @@ async def test_redis_client(instrument, elasticapm_client, redis_async_conn):
123
125
"port" : int (os .environ .get ("REDIS_PORT" , 6379 )),
124
126
"service" : {"name" : "" , "resource" : "redis" , "type" : "" },
125
127
}
128
+ assert spans [0 ]["duration" ] > 0.2 # sanity test to ensure we measure the actual call
126
129
127
130
assert spans [1 ]["name" ] == "RPUSH"
128
131
assert spans [1 ]["type" ] == "db"
@@ -133,6 +136,7 @@ async def test_redis_client(instrument, elasticapm_client, redis_async_conn):
133
136
"port" : int (os .environ .get ("REDIS_PORT" , 6379 )),
134
137
"service" : {"name" : "" , "resource" : "redis" , "type" : "" },
135
138
}
139
+ assert spans [1 ]["duration" ] > 0.2 # sanity test to ensure we measure the actual call
136
140
137
141
assert spans [2 ]["name" ] == "test_redis_client"
138
142
assert spans [2 ]["type" ] == "test"
@@ -169,6 +173,7 @@ async def test_publish_subscribe_async(instrument, elasticapm_client, redis_asyn
169
173
"port" : int (os .environ .get ("REDIS_PORT" , 6379 )),
170
174
"service" : {"name" : "" , "resource" : "redis" , "type" : "" },
171
175
}
176
+ assert spans [0 ]["duration" ] > 0.2 # sanity test to ensure we measure the actual call
172
177
173
178
assert spans [1 ]["name" ] == "SUBSCRIBE"
174
179
assert spans [1 ]["type" ] == "db"
@@ -179,6 +184,7 @@ async def test_publish_subscribe_async(instrument, elasticapm_client, redis_asyn
179
184
"port" : int (os .environ .get ("REDIS_PORT" , 6379 )),
180
185
"service" : {"name" : "" , "resource" : "redis" , "type" : "" },
181
186
}
187
+ assert spans [1 ]["duration" ] > 0.2 # sanity test to ensure we measure the actual call
182
188
183
189
assert spans [2 ]["name" ] == "test_publish_subscribe"
184
190
assert spans [2 ]["type" ] == "test"
0 commit comments