[wasm] Fix condition to use latest chrome for testing (#89890)
authorAnkit Jain <radical@gmail.com>
Thu, 3 Aug 2023 04:55:20 +0000 (00:55 -0400)
committerGitHub <noreply@github.com>
Thu, 3 Aug 2023 04:55:20 +0000 (00:55 -0400)
* [wasm] Fix condition to use latest chrome for testing
* [wasm] CI: Trigger WBT on changes in ProvisioningVersions.props

* [wasm] runtime: Fix creating the stack trace for a ManagedError

With the latest chrome (`115.*`) the following code in
`runtime/marshal.ts` fails because `this.superStack.value` is no longer
available:

```js
    getSuperStack() {
        if (this.superStack) {
            return this.superStack.value;
        }
        return super.stack; // this works on FF
    }
```

This causes the final error to not have the original managed error
message, and also have a `"undefined"` at the end of the string.

Truncated error missing the native part of the stack, and the message:
```
   at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.ThrowFromJSExport(String message)
   at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.__Wrapper_ThrowFromJSExport_271731536(JSMarshalerArgument* __arguments_buffer)
undefined
```

With the fix:
```
   at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.ThrowFromJSExport(String message)
   at System.Runtime.InteropServices.JavaScript.Tests.JavaScriptTestHelper.__Wrapper_ThrowFromJSExport_817705034(JSMarshalerArgument* __arguments_buffer)
Error: -t-e-s-t-
    at sr (http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:33284)
    at Br (http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:42679)
    at http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:40825
    at Module.catch1stack (http://127.0.0.1:60345/JavaScriptTestHelper.mjs:132:9)
    at http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:36627
    at mr (http://127.0.0.1:60345/_framework/dotnet.runtime.js:3:37821)
    at do_icall (http://127.0.0.1:60345/_framework/dotnet.native.wasm:wasm-function[221]:0x19711)
    at do_icall_wrapper (http://127.0.0.1:60345/_framework/dotnet.native.wasm:wasm-function[108]:0x157bc)
    at mono_interp_exec_method (http://127.0.0.1:60345/_framework/dotnet.native.wasm:wasm-function[101]:0x9c92)
    at interp_runtime_invoke (http://127.0.0.1:60345/_framework/dotnet.native.wasm:wasm-function[141]:0x16cd7)
```

Thanks to @kg for the fix.

eng/pipelines/common/evaluate-default-paths.yml
eng/testing/ProvisioningVersions.props
src/mono/wasm/runtime/marshal.ts

index 20d7bed..1e29765 100644 (file)
@@ -178,6 +178,7 @@ jobs:
       include:
       - eng/Version.Details.xml
       - eng/Versions.props
+        eng/testing/ProvisioningVersions.props
       - eng/testing/scenarios/BuildWasmAppsJobsList.txt
       - eng/testing/workloads-testing.targets
       - src/installer/pkg/sfx/Microsoft.NETCore.App/*
index 6ecfe71..251fa2d 100644 (file)
@@ -45,6 +45,8 @@
     <!-- To use a specific version, set ChromeFindLatestAvailableVersion=false,
          and set the version, and revisions in the propertygroup below -->
     <!--<ChromeFindLatestAvailableVersion>false</ChromeFindLatestAvailableVersion>-->
+
+    <ChromeFindLatestAvailableVersion Condition="'$(ChromeFindLatestAvailableVersion)' == ''">true</ChromeFindLatestAvailableVersion>
   </PropertyGroup>
 
   <PropertyGroup Label="Use specific version of chrome" Condition="'$(ChromeFindLatestAvailableVersion)' != 'true' and $([MSBuild]::IsOSPlatform('linux'))">
index 64f9fb0..262051d 100644 (file)
@@ -331,7 +331,10 @@ export class ManagedError extends Error implements IDisposable {
 
     getSuperStack() {
         if (this.superStack) {
-            return this.superStack.value;
+            if (this.superStack.value !== undefined)
+                return this.superStack.value;
+            if (this.superStack.get !== undefined)
+                return this.superStack.get.call(this);
         }
         return super.stack; // this works on FF
     }