You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've temporarily marked the affected async-iterator tests as conditional (windows/desktop-only).
Below is one example, which involves exceptions being thrown. The strange thing is that adding a simple Console.Write("CAUGHT") call makes the problem go away.
Other than that, many (if not all) async iterators also hang on CoreCLR, despite not involving exceptions.
[Fact]publicvoidTestThrownException_WhilePromiseActive(){stringsource=@"using static System.Console;class C{ public static async System.Threading.Tasks.Task Main() { var enumerator = new C().M().GetAsyncEnumerator(); await enumerator.WaitForNextAsync(); var value = enumerator.TryGetNext(out bool success); Assert(success); Assert(value == 42); enumerator.TryGetNext(out success); Assert(!success); try { await enumerator.WaitForNextAsync(); Write(""UNREACHABLE""); } catch (System.Exception e) { Assert(e.Message == ""message""); //Write($""CAUGHT""); // crash only happens if this line is commented out } Write(""Done""); } async System.Collections.Generic.IAsyncEnumerable<int> M() { yield return 42; await new System.Threading.Tasks.ValueTask(System.Threading.Tasks.Task.Delay(100)); bool b = true; if (b) throw new System.Exception(""message""); Write(""UNREACHABLE2""); } static void Assert(bool b) { if (!b) throw null; }}";varcomp= CreateCompilationWithTasksExtensions(new[]{ source, s_common }, options: TestOptions.DebugExe);
comp.VerifyDiagnostics();
CompileAndVerify(comp, expectedOutput:"Done");}
From discussion with Jeff Schwartz, this is a known issue with resolution rules and the TPA (trusted platform assemblies). Even though our test framework is ready to provide System.Threading.Tasks.Extensions version 4.2, it fails to load because the version in the TPA is 4.1 (the lookup gets downgraded and the result is then judged inacceptable).
Update (9/11/2018):
It turns out the issue is not with loading System.Threading.Tasks.Extensions after all. The Roslyn test utilities first ask the default AssemblyLoadContext for that assembly (which internally throws a FileNotFoundException, but eventually returns null) but then loads our own provided image via LoadAsStream). Jeff will take another look.
I've temporarily marked the affected async-iterator tests as conditional (windows/desktop-only).
Below is one example, which involves exceptions being thrown. The strange thing is that adding a simple
Console.Write("CAUGHT")
call makes the problem go away.Other than that, many (if not all) async iterators also hang on CoreCLR, despite not involving exceptions.
To run this test on CoreCLR:
Relates to PR #28218
The text was updated successfully, but these errors were encountered: