diff --git a/src/tests/async/collectible-alc/collectible-alc.cs b/src/tests/async/collectible-alc/collectible-alc.cs index 0feb988d4ac4a4..e6ac383f23292e 100644 --- a/src/tests/async/collectible-alc/collectible-alc.cs +++ b/src/tests/async/collectible-alc/collectible-alc.cs @@ -11,7 +11,7 @@ public class Async2CollectibleAlc { - [Fact] + [ConditionalFact(typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsCollectibleAssembliesSupported))] public static void TestEntryPoint() { AsyncEntryPoint().Wait(); diff --git a/src/tests/async/collectible-alc/collectible-alc.csproj b/src/tests/async/collectible-alc/collectible-alc.csproj index 3b3ebe1336c1dd..85c00a34c297c1 100644 --- a/src/tests/async/collectible-alc/collectible-alc.csproj +++ b/src/tests/async/collectible-alc/collectible-alc.csproj @@ -7,4 +7,7 @@ + + + diff --git a/src/tests/async/reflection/reflection-simple.cs b/src/tests/async/reflection/reflection-simple.cs index 354d97689fd5a7..853f1264946349 100644 --- a/src/tests/async/reflection/reflection-simple.cs +++ b/src/tests/async/reflection/reflection-simple.cs @@ -17,9 +17,19 @@ public static void MethodInfo_Invoke_TaskReturning() var mi = typeof(Async2Reflection).GetMethod("Foo", BindingFlags.Static | BindingFlags.NonPublic)!; Task r = (Task)mi.Invoke(null, null)!; - dynamic d = new Async2Reflection(); + int barResult; + if (TestLibrary.Utilities.IsNativeAot) + { + mi = typeof(Async2Reflection).GetMethod("Bar", BindingFlags.Instance | BindingFlags.NonPublic)!; + barResult = ((Task)mi.Invoke(new Async2Reflection(), null)!).Result; + } + else + { + dynamic d = new Async2Reflection(); + barResult = d.Bar().Result; + } - Assert.Equal(100, (int)(r.Result + d.Bar().Result)); + Assert.Equal(100, (int)(r.Result + barResult)); } [Fact] @@ -103,6 +113,7 @@ public Task TReturning() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/89157", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static void GetInterfaceMap() { Type interfaceType = typeof(IExample);