Skip to content

Commit b80d612

Browse files
committed
fix: test non panicking behavior
1 parent 28dc62b commit b80d612

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

opentelemetry-sdk/src/trace/span.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,15 +1143,13 @@ mod tests {
11431143
}
11441144

11451145
#[test]
1146-
#[should_panic]
11471146
fn test_finished_span_consume_twice() {
11481147
#[derive(Debug)]
11491148
struct TestSpanProcessor;
11501149
impl SpanProcessor for TestSpanProcessor {
11511150
fn on_end(&self, span: &mut FinishedSpan) {
11521151
let _ = span.consume();
1153-
// consume again to trigger panic
1154-
let _ = span.consume();
1152+
assert!(span.try_consume().is_none());
11551153
}
11561154

11571155
fn on_start(&self, _span: &mut Span, _cx: &opentelemetry::Context) {}

0 commit comments

Comments
 (0)