Skip to content

Commit f4bb48f

Browse files
committed
comment on text
1 parent f5ea469 commit f4bb48f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

opentelemetry/src/context.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,12 +824,22 @@ mod tests {
824824
let _outer = Context::enter_suppressed();
825825
assert_eq!(Context::is_current_suppressed(), true);
826826

827-
// Second level suppression (redundant but should work)
827+
// Second level. This component is unaware of Suppression,
828+
// and just attaches a new context. Since it is from current,
829+
// it'll already have suppression enabled.
828830
{
829-
let _inner = Context::enter_suppressed();
831+
let _inner = Context::current().with_value(ValueA(1)).attach();
830832
assert_eq!(Context::is_current_suppressed(), true);
831833
}
832834

835+
// Another scenario. This component is unaware of Suppression,
836+
// and just attaches a new context, not from Current. Since it is
837+
// not from current it will not have suppression enabled.
838+
{
839+
let _inner = Context::new().with_value(ValueA(1)).attach();
840+
assert_eq!(Context::is_current_suppressed(), false);
841+
}
842+
833843
// Still suppressed after inner scope
834844
assert_eq!(Context::is_current_suppressed(), true);
835845
}

0 commit comments

Comments
 (0)