[wasm] System.Net.WebSockets.Client.Tests timeouts (#85167)
authorPavel Savara <pavel.savara@gmail.com>
Mon, 24 Apr 2023 16:51:08 +0000 (18:51 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Apr 2023 16:51:08 +0000 (18:51 +0200)
Co-authored-by: Marek FiĊĦera <mara@neptuo.com>
src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj
src/mono/wasm/runtime/logging.ts
src/mono/wasm/test-main.js

index e15f88b3c369001eb900f64e295cfdbbd2c25d15..6bf74ea597ce703418d3760658120b93ba960502 100644 (file)
@@ -7,9 +7,6 @@
     <DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
     <!--Remove once this is fixed, https://github.com/dotnet/runtime/issues/71506 -->
     <IlcTrimMetadata>false</IlcTrimMetadata>
-
-    <!-- this test project is too slow with extra start of another runtime -->
-    <WasmXHarnessMonoArgs>$(WasmXHarnessMonoArgs) --no-memory-snapshot</WasmXHarnessMonoArgs>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(TargetOS)' == 'browser'">
@@ -18,6 +15,8 @@
     <TestArchiveTestsRoot>$(TestArchiveRoot)browserornodejs/</TestArchiveTestsRoot>
     <TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
     <DefineConstants>$(DefineConstants);TARGET_BROWSER</DefineConstants>
+    <WasmXHarnessMonoArgs>--setenv=XHARNESS_LOG_TEST_START=true --no-memory-snapshot</WasmXHarnessMonoArgs>
+    <WasmXHarnessTestsTimeout>00:45:00</WasmXHarnessTestsTimeout>
   </PropertyGroup>
 
   <ItemGroup>
index a4420b01f57f5f3a4e87d8b19b4e44949a318767..9e3bef14fa4792bfbeb67b9858263d51d9a90701 100644 (file)
@@ -131,8 +131,18 @@ export function setup_proxy_console(id: string, console: Console, origin: string
                     }
                 }
 
-                if (typeof payload === "string" && id !== "main")
-                    payload = `[${id}] ${payload}`;
+                if (typeof payload === "string") {
+                    if (payload[0] == "[") {
+                        const now = new Date().toISOString();
+                        if (id !== "main") {
+                            payload = `[${id}][${now}] ${payload}`;
+                        } else {
+                            payload = `[${now}] ${payload}`;
+                        }
+                    } else if (id !== "main") {
+                        payload = `[${id}] ${payload}`;
+                    }
+                }
 
                 if (asJson) {
                     func(JSON.stringify({
index 3d835c0bb614079f39f2a3c0eb627415a90c0895..475163ecfe5c0aa50a7d461c2d01ffaf867de0f1 100644 (file)
@@ -25,12 +25,12 @@ if (is_node && process.versions.node.split(".")[0] < 14) {
 
 if (is_node) {
     // the emscripten 3.1.34 stopped handling these when MODULARIZE is enabled
-    process.on('uncaughtException', function(ex) {
+    process.on('uncaughtException', function (ex) {
         // ignore UnhandledPromiseRejection exceptions with exit status
         if (ex !== 'unwind' && (ex.name !== "UnhandledPromiseRejection" || !ex.message.includes('"#<ExitStatus>"'))) {
-          throw ex;
+            throw ex;
         }
-      });
+    });
 }
 
 if (!is_node && !is_browser && typeof globalThis.crypto === 'undefined') {
@@ -387,6 +387,7 @@ async function run() {
                 const main_assembly_name = runArgs.applicationArguments[1];
                 const app_args = runArgs.applicationArguments.slice(2);
                 const result = await App.runtime.runMain(main_assembly_name, app_args);
+                console.log(`test-main.js exiting ${app_args.length > 1 ? main_assembly_name + " " + app_args[0] : main_assembly_name} with result ${result}`);
                 mono_exit(result);
             } catch (error) {
                 if (error.name != "ExitStatus") {