dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.06k stars 4.69k forks source link

[wasm][aot] `Microsoft.VisualBasic.Tests.FileSystemTests` failing due to use of `Assembly.GetCallingAssembly` #53815

Open radical opened 3 years ago

radical commented 3 years ago

With https://github.com/dotnet/runtime/pull/52883 [Microsoft.VisualBasic.Tests.FileSystemTests`]() started to fail with:

[18:33:08] fail: [FAIL] Microsoft.VisualBasic.Tests.FileSystemTests.Write_ArgumentException
[18:33:08] info: System.IO.IOException : Bad file name or number.
[18:33:08] info:    at Microsoft.VisualBasic.FileSystem.Write(Int32 , Object[] )
[18:33:08] info:    at Microsoft.VisualBasic.Tests.FileSystemTests.<>c__DisplayClass21_0.<Write_ArgumentException>b__0()
[18:33:08] info:    at Microsoft.VisualBasic.Tests.FileSystemTests.AssertThrows[ArgumentException](Action action)
[18:33:08] info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
[18:33:08] fail: [FAIL] Microsoft.VisualBasic.Tests.FileSystemTests.FileClose
[18:33:08] info: Assert.Equal() Failure
[18:33:08] info: Expected: 2
[18:33:08] info: Actual:   1
[18:33:08] info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
[18:33:08] fail: [FAIL] Microsoft.VisualBasic.Tests.FileSystemTests.FileOpen
[18:33:08] info: Assert.Throws() Failure
[18:33:08] info: Expected: typeof(System.IO.IOException)
[18:33:08] info: Actual:   (No exception was thrown)
[18:33:08] info:    at Microsoft.VisualBasic.Tests.FileSystemTests.AssertThrows[IOException](Action action)
[18:33:08] info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
[18:33:27] info: Finished:    Microsoft.VisualBasic.Core.Tests.dll
[18:33:27] info: 
[18:33:27] info: === TEST EXECUTION SUMMARY ===

@vargaz said:

The Microsoft.VisualBasic failures seem to be related to calls made to Assembly.GetCallingAssembly () which is not supported in wasm+aot, not sure why this worked previously.

ghost commented 3 years ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Issue Details
With https://github.com/dotnet/runtime/pull/52883 [Microsoft.VisualBasic.Tests.FileSystemTests`]() started to fail with: ``` [18:33:08] fail: [FAIL] Microsoft.VisualBasic.Tests.FileSystemTests.Write_ArgumentException [18:33:08] info: System.IO.IOException : Bad file name or number. [18:33:08] info: at Microsoft.VisualBasic.FileSystem.Write(Int32 , Object[] ) [18:33:08] info: at Microsoft.VisualBasic.Tests.FileSystemTests.<>c__DisplayClass21_0.b__0() [18:33:08] info: at Microsoft.VisualBasic.Tests.FileSystemTests.AssertThrows[ArgumentException](Action action) [18:33:08] info: at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo ) [18:33:08] fail: [FAIL] Microsoft.VisualBasic.Tests.FileSystemTests.FileClose [18:33:08] info: Assert.Equal() Failure [18:33:08] info: Expected: 2 [18:33:08] info: Actual: 1 [18:33:08] info: at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo ) [18:33:08] fail: [FAIL] Microsoft.VisualBasic.Tests.FileSystemTests.FileOpen [18:33:08] info: Assert.Throws() Failure [18:33:08] info: Expected: typeof(System.IO.IOException) [18:33:08] info: Actual: (No exception was thrown) [18:33:08] info: at Microsoft.VisualBasic.Tests.FileSystemTests.AssertThrows[IOException](Action action) [18:33:08] info: at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo ) [18:33:27] info: Finished: Microsoft.VisualBasic.Core.Tests.dll [18:33:27] info: [18:33:27] info: === TEST EXECUTION SUMMARY === ``` @vargaz [said](https://github.com/dotnet/runtime/pull/52883#issuecomment-848385262): `The Microsoft.VisualBasic failures seem to be related to calls made to Assembly.GetCallingAssembly () which is not supported in wasm+aot, not sure why this worked previously.`
Author: radical
Assignees: -
Labels: `arch-wasm`, `area-Codegen-AOT-mono`, `wasm-aot-test`
Milestone: -