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

[Profiler] Adjust profiler tests for .NET 8 #4908

Merged
merged 1 commit into from
Nov 23, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,11 @@ public void ThrowExceptionsInParallel(string appName, string framework, string a
new StackFrame("|lm:Samples.ExceptionGenerator |ns:Samples.ExceptionGenerator |ct:ParallelExceptionsScenario |cg: |fn:ThrowExceptions |fg: |sg:(object state)"),
new StackFrame("|lm:System.Private.CoreLib |ns:System.Threading |ct:Thread |cg: |fn:StartCallback |fg: |sg:()"));
}
else if (framework == "net7.0")
else if (framework == "net7.0" || framework == "net8.0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I probably should have just tried that 😂 🤦‍♂️

{
expectedStack = new StackTrace(
new StackFrame("|lm:Samples.ExceptionGenerator |ns:Samples.ExceptionGenerator |ct:ParallelExceptionsScenario |cg: |fn:ThrowExceptions |fg: |sg:(object state)"));
}
else if (framework == "net8.0")
{
// TODO: Update this to suport .NET 8
return;
}
else
{
expectedStack = new StackTrace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc.
// </copyright>

using System;
using System.Linq;
using Datadog.Profiler.IntegrationTests.Helpers;
Expand Down Expand Up @@ -40,18 +41,12 @@ public void ValidateSignatures(string appName, string framework, string appAssem
CheckExceptionsInProfiles(framework, exceptionSamples);
}

private void CheckExceptionsInProfiles(string framework, (string Type, string Message, long Count, StackTrace Stacktrace)[] exceptionSamples)
private static void CheckExceptionsInProfiles(string framework, (string Type, string Message, long Count, StackTrace Stacktrace)[] exceptionSamples)
{
PlatformID os = Environment.OSVersion.Platform;
var os = Environment.OSVersion.Platform;
StackTrace stack;
if (os == PlatformID.Unix)
if (os == PlatformID.Unix && framework != "net8.0")
{
if (framework == "net8.0")
{
// TODO: fix this - they may have fixed the bug in .NET 8!
return;
}

// BUG on Linux: invalid TKey instead of TVal
stack = new StackTrace(
new StackFrame("|lm:Samples.Computer01 |ns:Samples.Computer01 |ct:GenericClass |cg:<TKey, TKey> |fn:ThrowFromGeneric |fg:<T0> |sg:(T0 element, TKey key1, TKey value, TKey key2)"),
Expand Down
Loading