Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit e4e4c85

Browse files
Sergey KanzhelevSergey Kanzhelev
authored andcommitted
fix unit tests after mixed up statics initialization
1 parent 06c438e commit e4e4c85

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/OpenCensus/Impl/Trace/Config/TraceParams.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@ namespace OpenCensus.Trace.Config
2222
public sealed class TraceParams : ITraceParams
2323
{
2424
public static readonly ITraceParams DEFAULT =
25-
new TraceParams(DEFAULT_SAMPLER, DEFAULT_SPAN_MAX_NUM_ATTRIBUTES, DEFAULT_SPAN_MAX_NUM_ANNOTATIONS, DEFAULT_SPAN_MAX_NUM_MESSAGE_EVENTS, DEFAULT_SPAN_MAX_NUM_LINKS);
25+
new TraceParams(Samplers.GetProbabilitySampler(DefaultProbability), DEFAULT_SPAN_MAX_NUM_ATTRIBUTES, DEFAULT_SPAN_MAX_NUM_ANNOTATIONS, DEFAULT_SPAN_MAX_NUM_MESSAGE_EVENTS, DEFAULT_SPAN_MAX_NUM_LINKS);
2626

2727
private const double DefaultProbability = 1e-4;
2828
private const int DEFAULT_SPAN_MAX_NUM_ATTRIBUTES = 32;
2929
private const int DEFAULT_SPAN_MAX_NUM_ANNOTATIONS = 32;
3030
private const int DEFAULT_SPAN_MAX_NUM_MESSAGE_EVENTS = 128;
3131
private const int DEFAULT_SPAN_MAX_NUM_LINKS = 128;
3232

33-
private static readonly ISampler DEFAULT_SAMPLER = Samplers.GetProbabilitySampler(DefaultProbability);
34-
3533
internal TraceParams(ISampler sampler, int maxNumberOfAttributes, int maxNumberOfAnnotations, int maxNumberOfMessageEvents, int maxNumberOfLinks)
3634
{
3735
if (maxNumberOfAttributes <= 0)

test/OpenCensus.Tests/OpenCensus.Tests.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,20 @@
1616
<CodeAnalysisRuleSet>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenCensus.sln'))\build\OpenCensus.test.ruleset</CodeAnalysisRuleSet>
1717
</PropertyGroup>
1818

19+
<ItemGroup>
20+
<None Remove="xunit.runner.json" />
21+
</ItemGroup>
22+
1923
<ItemGroup>
2024
<AdditionalFiles Include="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenCensus.sln'))\build\stylecop.json" />
2125
</ItemGroup>
2226

27+
<ItemGroup>
28+
<Content Include="xunit.runner.json">
29+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30+
</Content>
31+
</ItemGroup>
32+
2333
<ItemGroup>
2434
<ProjectReference Include="..\..\src\OpenCensus\OpenCensus.csproj" />
2535
</ItemGroup>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"maxParallelThreads": 1,
3+
"parallelizeTestCollections": false
4+
}

0 commit comments

Comments
 (0)