Skip to content

Conversation

@pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Jul 11, 2022

  • protect class names from mangling. Fixes:
    • System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JSImportException
    • System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JSImportException
    • See log
[16:44:33] fail: [FAIL] System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JSImportException(value: System.Exception: Test, clazz: "ManagedError")
[16:44:33] info: Assert.Equal() Failure
[16:44:33] info:           ↓ (pos 0)
[16:44:33] info: Expected: ManagedError
[16:44:33] info: Actual:   jr
[16:44:33] info:           ↑ (pos 0)
[16:44:33] info:    at System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JsImportTest[Exception](Exception value, Action`1 store1, Func`1 retrieve1, Func`2 echo1, Func`2 throw1, Func`2 identity1, String jsType, String jsClass)
[16:44:33] info:    at System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JSImportException(Exception value, String clazz)
[16:44:33] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
[16:44:33] fail: [FAIL] System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JSImportObject(value: Object { }, clazz: "ManagedObject")
[16:44:33] info: Assert.Equal() Failure
[16:44:33] info:           ↓ (pos 0)
[16:44:33] info: Expected: ManagedObject
[16:44:33] info: Actual:   Rr
[16:44:33] info:           ↑ (pos 0)
[16:44:33] info:    at System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JsImportTest[Object](Object value, Action`1 store1, Func`1 retrieve1, Func`2 echo1, Func`2 throw1, Func`2 identity1, String jsType, String jsClass)
[16:44:33] info:    at System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JSImportObject(Object value, String clazz)
[16:44:33] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)

Fixes #71952

@pavelsavara pavelsavara added this to the 7.0.0 milestone Jul 11, 2022
@pavelsavara pavelsavara requested review from kg and radical July 11, 2022 21:36
@pavelsavara pavelsavara self-assigned this Jul 11, 2022
@pavelsavara pavelsavara requested a review from lewing as a code owner July 11, 2022 21:36
@ghost
Copy link

ghost commented Jul 11, 2022

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

Issue Details

Fixes [FAIL] System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JSImportException
and [FAIL] System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JSImportException

See log

Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone: 7.0.0

.. failing as:

```
[09:26:02] fail: [FAIL] System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.JsImportObjectArray
[09:26:02] info: System.Runtime.InteropServices.JavaScript.JSException : Error: Assert failed: ES6 module JavaScriptTestHelper was not imported yet, please call JSHost.Import() first.
[09:26:02] info:     at mono_wasm_lookup_function (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:131530)
[09:26:02] info:     at Object.mono_wasm_bind_js_function (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:129592)
[09:26:02] info:     at _mono_wasm_bind_js_function (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:103196)
[09:26:02] info:     at do_icall (do_icall (<anonymous>:wasm-function[320]):0x1d48)e
[09:26:02] info:     at do_icall_wrapper (do_icall_wrapper (<anonymous>:wasm-function[290]):0x1c89)3
[09:26:02] info:     at interp_exec_method (interp_exec_method (<anonymous>:wasm-function[228]):0xe11)9
[09:26:02] info:     at interp_runtime_invoke (interp_runtime_invoke (<anonymous>:wasm-function[227]):0xcfe)5
[09:26:02] info:     at mono_jit_runtime_invoke (mono_jit_runtime_invoke (<anonymous>:wasm-function[8109]):0x1a141)9
[09:26:02] info:     at do_runtime_invoke (do_runtime_invoke (<anonymous>:wasm-function[2050]):0x84c9)3
[09:26:02] info:     at mono_runtime_try_invoke (mono_runtime_try_invoke (<anonymous>:wasm-function[2055]):0x852f)b
[09:26:02] info:     at mono_runtime_invoke (mono_runtime_invoke (<anonymous>:wasm-function[2082]):0x873b)a
[09:26:02] info:     at mono_wasm_invoke_method_ref (mono_wasm_invoke_method_ref (<anonymous>:wasm-function[121]):0x9ce0)
[09:26:02] info:     at Module._mono_wasm_invoke_method_ref (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:125660)
[09:26:02] info:     at Object.t.<computed> (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:5668)
[09:26:02] info:     at _call_method_with_converted_args (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:68736)
[09:26:02] info:     at call_method_ref (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:67909)
[09:26:02] info:     at /datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:69762
[09:26:02] info:     at mono_call_assembly_entry_point (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:69894)
[09:26:02] info:     at Object.mono_run_main (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:78650)
[09:26:02] info:     at Object.init (test-main.js:495:47)
[09:26:02] info:     at Object.onDotnetReady (test-main.js:439:17)
[09:26:02] info:     at finalize_startup (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:120653)
[09:26:02] info:     at mono_wasm_after_runtime_initialized (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:3:116586)
[09:26:02] info:     at callRuntimeCallbacks (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:16200)
[09:26:02] info:     at postRun (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:12076)
[09:26:02] info:     at doRun (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:144539)
[09:26:02] info:     at run (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:144696)
[09:26:02] info:     at runCaller (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:144176)
[09:26:02] info:     at removeRunDependency (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:12868)
[09:26:02] info:     at receiveInstance (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:14757)
[09:26:02] info:     at receiveInstantiationResult (/datadisks/disk1/work/98BF08F2/w/A36B0892/e/dotnet.js:12:14878)
[09:26:02] info:    at System.Runtime.InteropServices.JavaScript.JSFunctionBinding.BindJSFunctionImpl(String functionName, String moduleName, ReadOnlySpan`1 signatures)
[09:26:02] info:    at System.Runtime.InteropServices.JavaScript.JSFunctionBinding.BindJSFunction(String functionName, String moduleName, ReadOnlySpan`1 signatures)
[09:26:02] info:    at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.createData(String name)
[09:26:02] info:    at System.Runtime.InteropServices.JavaScript.Tests.JSImportExportTest.MarshalObjectArrayCases()+MoveNext()
[09:26:02] info:    at System.Linq.Enumerable.SelectEnumerableIterator`2[[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object[], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
```

This is because the xunit is enumerating the member data before the
static `InitializeAsync` has completed.  And this member data calls
`JavaScriptTestHelper.createData("test")` before we are ready.

Fixes dotnet#71952 .
@radical
Copy link
Member

radical commented Jul 11, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radical radical changed the title [wasm] protect class names from mangling [wasm] Fix some failing System.Runtime.InteropServices.JavaScript.Tests Jul 11, 2022
@radical
Copy link
Member

radical commented Jul 12, 2022

Failures will be fixed by #71875 .

@radical radical merged commit 5ab4175 into dotnet:main Jul 12, 2022
@pavelsavara pavelsavara deleted the wasm_protect_class_names branch July 14, 2022 20:47
@ghost ghost locked as resolved and limited conversation to collaborators Aug 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

3 participants