Skip to content

Commit

Permalink
Fixed the unit test TracerSdkSetsActivitySamplingResultBasedOnSamplin…
Browse files Browse the repository at this point in the history
…gDecision
  • Loading branch information
utpilla committed Jan 21, 2021
1 parent 59fdea9 commit 0f5491e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ public void TracerSdkSetsActivitySamplingResultBasedOnSamplingDecision()

using (var activity = activitySource.StartActivity("root"))
{
// Even if sampling returns false, for root activities,
// activity is still created with PropagationOnly.
Assert.NotNull(activity);
Assert.True(activity.IsAllDataRequested);
Assert.False(activity.Recorded);
Expand All @@ -176,17 +174,19 @@ public void TracerSdkSetsActivitySamplingResultBasedOnSamplingDecision()

using (var activity = activitySource.StartActivity("root"))
{
// Even if sampling returns false, for root activities,
// Even if sampling returns false,
// activity is still created with PropagationOnly.
Assert.NotNull(activity);
Assert.False(activity.IsAllDataRequested);
Assert.False(activity.Recorded);

using (var innerActivity = activitySource.StartActivity("inner"))
{
// This is not a root activity.
// If sampling returns false, no activity is created at all.
Assert.Null(innerActivity);
// If sampling returns false, activity is created with PropagationOnly regardless
// of whether the activity is root or not.
Assert.NotNull(activity);
Assert.False(activity.IsAllDataRequested);
Assert.False(activity.Recorded);
}
}
}
Expand Down

0 comments on commit 0f5491e

Please sign in to comment.