Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Targeting updated to Net7, Net6, Net472; resolved Linux bug; upgraded packages w/ security vulnerabilities #171

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Sources/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,14 @@ csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_statements = false
[*.cs]

# Default severity for analyzer diagnostics with category 'StyleCop.CSharp.NamingRules'
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.NamingRules.severity = none

# Default severity for all analyzer diagnostics
dotnet_analyzer_diagnostic.severity = none

# SA1314: Type parameter names should begin with T
dotnet_diagnostic.SA1314.severity = none
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net472</TargetFrameworks>
<Platforms>x64;AnyCPU</Platforms>
</PropertyGroup>

Expand All @@ -11,11 +11,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="3.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="4.4.0" />
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net472</TargetFrameworks>
<Platforms>x64;AnyCPU</Platforms>
</PropertyGroup>

Expand All @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="3.1.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Scripting" Version="4.4.0" />
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
<PackageReference Include="System.Linq.Expressions" Version="4.3.0" />
Expand Down
12 changes: 10 additions & 2 deletions Sources/Core/Microsoft.StreamProcessing/Utilities/Native32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,16 @@ internal static void AffinitizeThread(int processor)
{
if (utid == pt.Id)
{
long AffinityMask = 1 << processor;
pt.ProcessorAffinity = (IntPtr)(AffinityMask); // Set affinity for this
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
pt.IdealProcessor = processor;
}

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
long AffinityMask = 1 << processor;
pt.ProcessorAffinity = (IntPtr)(AffinityMask); // Set affinity for this
}
}
}
}
Expand Down
24 changes: 24 additions & 0 deletions Sources/Test/SimpleTesting/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsColumnar.CheckpointRegressionColumnar")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsColumnar.MaxBug0Columnar")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsColumnar.MaxBug1Columnar")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsColumnar.MaxBug2Columnar")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsColumnarSmallBatch.CheckpointRegressionColumnarSmallBatch")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsColumnarSmallBatch.MaxBug0ColumnarSmallBatch")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsColumnarSmallBatch.MaxBug1ColumnarSmallBatch")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsColumnarSmallBatch.MaxBug2ColumnarSmallBatch")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsRow.CheckpointRegressionRow")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsRow.MaxBug0Row")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsRow.MaxBug1Row")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsRow.MaxBug2Row")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsRowSmallBatch.CheckpointRegressionRowSmallBatch")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsRowSmallBatch.MaxBug0RowSmallBatch")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsRowSmallBatch.MaxBug1RowSmallBatch")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.CheckpointRestoreTestsRowSmallBatch.MaxBug2RowSmallBatch")]
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1305:Field names should not use Hungarian notation", Justification = "<Pending>", Scope = "member", Target = "~M:SimpleTesting.Extensions.ToEvents``1(System.Collections.Generic.IEnumerable{``0},System.Func{``0,System.Int64},System.Func{``0,System.Int64})~System.Collections.Generic.IEnumerable{Microsoft.StreamProcessing.StreamEvent{``0}}")]
16 changes: 8 additions & 8 deletions Sources/Test/SimpleTesting/Macros/LeftOuterJoinTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public void LOJ1Row()
var query =
leftStream.LeftOuterJoin(rightStream, e => e.field1, e => e.field3,
(l, r) => l.field2 != "E",
(l) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = tmp1, field4 = tmp2 },
(l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 });
(l) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = tmp1, field4 = tmp2 },
(l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 });

var result = container.RegisterOutput(query, ReshapingPolicy.CoalesceEndEdges).Where(e => e.IsData);
var resultAsync = result.ForEachAsync(o => output.Add(o));
Expand Down Expand Up @@ -144,8 +144,8 @@ public void LOJ1RowSmallBatch()
var query =
leftStream.LeftOuterJoin(rightStream, e => e.field1, e => e.field3,
(l, r) => l.field2 != "E",
(l) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = tmp1, field4 = tmp2 },
(l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 });
(l) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = tmp1, field4 = tmp2 },
(l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 });

var result = container.RegisterOutput(query, ReshapingPolicy.CoalesceEndEdges).Where(e => e.IsData);
var resultAsync = result.ForEachAsync(o => output.Add(o));
Expand Down Expand Up @@ -205,8 +205,8 @@ public void LOJ1Columnar()
var query =
leftStream.LeftOuterJoin(rightStream, e => e.field1, e => e.field3,
(l, r) => l.field2 != "E",
(l) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = tmp1, field4 = tmp2 },
(l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 });
(l) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = tmp1, field4 = tmp2 },
(l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 });

var result = container.RegisterOutput(query, ReshapingPolicy.CoalesceEndEdges).Where(e => e.IsData);
var resultAsync = result.ForEachAsync(o => output.Add(o));
Expand Down Expand Up @@ -267,8 +267,8 @@ public void LOJ1ColumnarSmallBatch()
var query =
leftStream.LeftOuterJoin(rightStream, e => e.field1, e => e.field3,
(l, r) => l.field2 != "E",
(l) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = tmp1, field4 = tmp2 },
(l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 });
(l) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = tmp1, field4 = tmp2 },
(l, r) => new MyData3 { field1 = l.field1, field2 = l.field2, field3 = r.field3, field4 = r.field4 });

var result = container.RegisterOutput(query, ReshapingPolicy.CoalesceEndEdges).Where(e => e.IsData);
var resultAsync = result.ForEachAsync(o => output.Add(o));
Expand Down
17 changes: 12 additions & 5 deletions Sources/Test/SimpleTesting/SimpleTesting.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net472</TargetFrameworks>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Reactive" Version="5.0.0" />
<PackageReference Include="System.Reactive.Linq" Version="5.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>

<!--
Expand Down Expand Up @@ -160,6 +160,13 @@
<DependentUpon>ShuffleStreamableTests.tt</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<PackageReference Update="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(MSBuildAssemblyVersion)\TextTemplating\Microsoft.TextTemplating.targets" />

Expand Down
52 changes: 26 additions & 26 deletions Sources/Test/SimpleTesting/Streamables/AfaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -845,15 +845,15 @@ public void GroupedAfa()
var source = new StreamEvent<Tuple<string, int>>[]
{
StreamEvent.CreateStart(0, new Tuple<string, int>("A", 1)),
StreamEvent.CreateStart(1, new Tuple<string, int>("A", 2)),
StreamEvent.CreateStart(2, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(1, new Tuple<string, int>("A", 2)),
StreamEvent.CreateStart(2, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(3, new Tuple<string, int>("A", 1)),
StreamEvent.CreateStart(4, new Tuple<string, int>("B", 1)),
StreamEvent.CreateStart(5, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(5, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(6, new Tuple<string, int>("B", 1)),
StreamEvent.CreateStart(7, new Tuple<string, int>("C", 1)),
StreamEvent.CreateStart(8, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(9, new Tuple<string, int>("A", 2)),
StreamEvent.CreateStart(8, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(9, new Tuple<string, int>("A", 2)),
}.ToObservable()
.ToStreamable()
.AlterEventDuration(7);
Expand Down Expand Up @@ -893,18 +893,18 @@ public void GroupedAfa_IsSyncTimeSimultaneityFree()
var source = new StreamEvent<Tuple<string, int>>[]
{
StreamEvent.CreateStart(0, new Tuple<string, int>("A", 1)),
StreamEvent.CreateStart(1, new Tuple<string, int>("A", 2)),
StreamEvent.CreateStart(1, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(1, new Tuple<string, int>("A", 2)),
StreamEvent.CreateStart(1, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(3, new Tuple<string, int>("A", 1)),

StreamEvent.CreatePunctuation<Tuple<string, int>>(4),

StreamEvent.CreateStart(4, new Tuple<string, int>("B", 1)),
StreamEvent.CreateStart(4, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(4, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(5, new Tuple<string, int>("B", 1)),
StreamEvent.CreateStart(5, new Tuple<string, int>("C", 1)),
StreamEvent.CreateStart(6, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(7, new Tuple<string, int>("A", 2)),
StreamEvent.CreateStart(6, new Tuple<string, int>("B", 2)),
StreamEvent.CreateStart(7, new Tuple<string, int>("A", 2)),

StreamEvent.CreatePunctuation<Tuple<string, int>>(7),
}.ToObservable()
Expand Down Expand Up @@ -959,23 +959,23 @@ public void PartitionedAfa()
var source = new PartitionedStreamEvent<int, string>[]
{
PartitionedStreamEvent.CreateStart(1, 0, "A"),
PartitionedStreamEvent.CreateStart(2, 0, "A"),
PartitionedStreamEvent.CreateStart(2, 0, "A"),
PartitionedStreamEvent.CreateStart(1, 1, "B"),
PartitionedStreamEvent.CreateStart(1, 2, "B"),
PartitionedStreamEvent.CreateStart(2, 2, "B"),
PartitionedStreamEvent.CreateStart(2, 2, "B"),
PartitionedStreamEvent.CreateStart(1, 3, "A"),
PartitionedStreamEvent.CreateStart(1, 4, "C"),
PartitionedStreamEvent.CreateStart(2, 3, "C"),
PartitionedStreamEvent.CreateStart(2, 4, "A"),
PartitionedStreamEvent.CreateStart(2, 3, "C"),
PartitionedStreamEvent.CreateStart(2, 4, "A"),
PartitionedStreamEvent.CreateStart(1, 5, "A"),
PartitionedStreamEvent.CreateStart(1, 6, "B"),
PartitionedStreamEvent.CreateStart(2, 5, "B"),
PartitionedStreamEvent.CreateStart(2, 5, "B"),
PartitionedStreamEvent.CreateStart(1, 7, "B"),
PartitionedStreamEvent.CreateStart(2, 6, "B"),
PartitionedStreamEvent.CreateStart(2, 6, "B"),
PartitionedStreamEvent.CreateStart(1, 8, "B"),
PartitionedStreamEvent.CreateStart(1, 9, "A"),
PartitionedStreamEvent.CreateStart(2, 7, "A"),
PartitionedStreamEvent.CreateStart(2, 8, "B")
PartitionedStreamEvent.CreateStart(2, 7, "A"),
PartitionedStreamEvent.CreateStart(2, 8, "B")
}.ToObservable()
.ToStreamable()
.AlterEventDuration(7);
Expand Down Expand Up @@ -1016,23 +1016,23 @@ public void PartitionedAfa_IsSyncTimeSimultaneityFree()
var source = new PartitionedStreamEvent<int, string>[]
{
PartitionedStreamEvent.CreateStart(1, 0, "A"),
PartitionedStreamEvent.CreateStart(2, 0, "A"),
PartitionedStreamEvent.CreateStart(2, 0, "A"),
PartitionedStreamEvent.CreateStart(1, 1, "B"),
PartitionedStreamEvent.CreateStart(1, 1, "B"),
PartitionedStreamEvent.CreateStart(2, 0, "B"),
PartitionedStreamEvent.CreateStart(2, 0, "B"),
PartitionedStreamEvent.CreateStart(1, 3, "A"),
PartitionedStreamEvent.CreateStart(1, 4, "C"),
PartitionedStreamEvent.CreateStart(2, 3, "C"),
PartitionedStreamEvent.CreateStart(2, 4, "A"),
PartitionedStreamEvent.CreateStart(2, 3, "C"),
PartitionedStreamEvent.CreateStart(2, 4, "A"),
PartitionedStreamEvent.CreateStart(1, 5, "A"),
PartitionedStreamEvent.CreateStart(1, 6, "B"),
PartitionedStreamEvent.CreateStart(2, 4, "B"),
PartitionedStreamEvent.CreateStart(2, 4, "B"),
PartitionedStreamEvent.CreateStart(1, 7, "B"),
PartitionedStreamEvent.CreateStart(2, 6, "B"),
PartitionedStreamEvent.CreateStart(2, 6, "B"),
PartitionedStreamEvent.CreateStart(1, 8, "B"),
PartitionedStreamEvent.CreateStart(1, 9, "A"),
PartitionedStreamEvent.CreateStart(2, 7, "A"),
PartitionedStreamEvent.CreateStart(2, 8, "B")
PartitionedStreamEvent.CreateStart(2, 7, "A"),
PartitionedStreamEvent.CreateStart(2, 8, "B")
}.ToObservable()
.ToStreamable()
.AlterEventDuration(7);
Expand Down
Loading