diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 5baf88cd19b0d..394e0b84682e3 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -103,6 +103,9 @@ public static bool IsPrivilegedProcess public static bool IsReleaseRuntime => s_isReleaseRuntime.Value; public static bool IsDebugRuntime => s_isDebugRuntime.Value; + public static bool IsReleaseLibrary(Assembly assembly) => !IsDebuggable(assembly); + public static bool IsDebugLibrary(Assembly assembly) => IsDebuggable(assembly); + // For use as needed on tests that time out when run on a Debug runtime. // Not relevant for timeouts on external activities, such as network timeouts. public static int SlowRuntimeTimeoutModifier = (PlatformDetection.IsDebugRuntime ? 5 : 1); @@ -661,6 +664,13 @@ private static bool AssemblyConfigurationEquals(string configuration) string.Equals(assemblyConfigurationAttribute.Configuration, configuration, StringComparison.InvariantCulture); } + private static bool IsDebuggable(Assembly assembly) + { + DebuggableAttribute debuggableAttribute = assembly.GetCustomAttribute(); + + return debuggableAttribute != null && debuggableAttribute.IsJITTrackingEnabled; + } + private static bool GetSupportsSha3() { if (IsOpenSslSupported) diff --git a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicRemoteExecutorTests.cs b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicRemoteExecutorTests.cs index 3aa7d11b508c5..4cab4fa3063b7 100644 --- a/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicRemoteExecutorTests.cs +++ b/src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicRemoteExecutorTests.cs @@ -22,7 +22,7 @@ public MsQuicRemoteExecutorTests() [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] public void SslKeyLogFile_IsCreatedAndFilled() { - if (PlatformDetection.IsReleaseRuntime) + if (PlatformDetection.IsReleaseLibrary(typeof(QuicConnection).Assembly)) { throw new SkipTestException("Retrieving SSL secrets is not supported in Release mode."); }