File tree 1 file changed +7
-2
lines changed
opentelemetry-sdk/src/metrics
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -327,13 +327,18 @@ mod tests {
327
327
. is_shutdown
328
328
. load( std:: sync:: atomic:: Ordering :: Relaxed ) ) ;
329
329
assert ! ( !reader. is_shutdown( ) ) ;
330
- // create a meter
331
- let _meter = global:: meter ( "test" ) ;
330
+ // create a meter and an instrument
331
+ let meter = global:: meter ( "test" ) ;
332
+ let counter = meter. u64_counter ( "test_counter" ) . init ( ) ;
332
333
// no need to drop a meter for meter_provider shutdown
333
334
global:: shutdown_meter_provider ( ) ;
334
335
assert ! ( provider
335
336
. is_shutdown
336
337
. load( std:: sync:: atomic:: Ordering :: Relaxed ) ) ;
337
338
assert ! ( reader. is_shutdown( ) ) ;
339
+ // TODO - assert that the instrument is no longer usable
340
+ // As of now, even after shutdown, the instrument can still be used.
341
+ // Even though reader is shutdown, and no collect will happen.
342
+ assert ! ( counter. add( 1 , & [ ] ) == ( ) ) ;
338
343
}
339
344
}
You can’t perform that action at this time.
0 commit comments