Skip to content

Commit c3a2bce

Browse files
pavelsavaramaraf
andauthored
[wasm] System.Net.WebSockets.Client.Tests timeouts (#85167)
Co-authored-by: Marek Fišera <[email protected]>
1 parent 1ad1f65 commit c3a2bce

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
88
<!--Remove once this is fixed, https://github.com/dotnet/runtime/issues/71506 -->
99
<IlcTrimMetadata>false</IlcTrimMetadata>
10-
11-
<!-- this test project is too slow with extra start of another runtime -->
12-
<WasmXHarnessMonoArgs>$(WasmXHarnessMonoArgs) --no-memory-snapshot</WasmXHarnessMonoArgs>
1310
</PropertyGroup>
1411

1512
<PropertyGroup Condition="'$(TargetOS)' == 'browser'">
@@ -18,6 +15,8 @@
1815
<TestArchiveTestsRoot>$(TestArchiveRoot)browserornodejs/</TestArchiveTestsRoot>
1916
<TestArchiveTestsDir>$(TestArchiveTestsRoot)$(OSPlatformConfig)/</TestArchiveTestsDir>
2017
<DefineConstants>$(DefineConstants);TARGET_BROWSER</DefineConstants>
18+
<WasmXHarnessMonoArgs>--setenv=XHARNESS_LOG_TEST_START=true --no-memory-snapshot</WasmXHarnessMonoArgs>
19+
<WasmXHarnessTestsTimeout>00:45:00</WasmXHarnessTestsTimeout>
2120
</PropertyGroup>
2221

2322
<ItemGroup>

src/mono/wasm/runtime/logging.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,18 @@ export function setup_proxy_console(id: string, console: Console, origin: string
131131
}
132132
}
133133

134-
if (typeof payload === "string" && id !== "main")
135-
payload = `[${id}] ${payload}`;
134+
if (typeof payload === "string") {
135+
if (payload[0] == "[") {
136+
const now = new Date().toISOString();
137+
if (id !== "main") {
138+
payload = `[${id}][${now}] ${payload}`;
139+
} else {
140+
payload = `[${now}] ${payload}`;
141+
}
142+
} else if (id !== "main") {
143+
payload = `[${id}] ${payload}`;
144+
}
145+
}
136146

137147
if (asJson) {
138148
func(JSON.stringify({

src/mono/wasm/test-main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ if (is_node && process.versions.node.split(".")[0] < 14) {
2525

2626
if (is_node) {
2727
// the emscripten 3.1.34 stopped handling these when MODULARIZE is enabled
28-
process.on('uncaughtException', function(ex) {
28+
process.on('uncaughtException', function (ex) {
2929
// ignore UnhandledPromiseRejection exceptions with exit status
3030
if (ex !== 'unwind' && (ex.name !== "UnhandledPromiseRejection" || !ex.message.includes('"#<ExitStatus>"'))) {
31-
throw ex;
31+
throw ex;
3232
}
33-
});
33+
});
3434
}
3535

3636
if (!is_node && !is_browser && typeof globalThis.crypto === 'undefined') {
@@ -387,6 +387,7 @@ async function run() {
387387
const main_assembly_name = runArgs.applicationArguments[1];
388388
const app_args = runArgs.applicationArguments.slice(2);
389389
const result = await App.runtime.runMain(main_assembly_name, app_args);
390+
console.log(`test-main.js exiting ${app_args.length > 1 ? main_assembly_name + " " + app_args[0] : main_assembly_name} with result ${result}`);
390391
mono_exit(result);
391392
} catch (error) {
392393
if (error.name != "ExitStatus") {

0 commit comments

Comments
 (0)