Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[debugger][mt] Unify multithreading switches #97861

Merged
merged 4 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static bool ReleaseRuntime
#else
=> false;
#endif
public static bool WasmMultiThreaded => EnvironmentVariables.WasmTestsUsingVariant == "multithreaded";
public static bool WasmMultiThreaded => EnvironmentVariables.WasmEnableThreads;

public static bool WasmSingleThreaded => !WasmMultiThreaded;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@

internal static class EnvironmentVariables
{
public static readonly string? DebuggerTestPath = Environment.GetEnvironmentVariable("DEBUGGER_TEST_PATH");
public static readonly string? TestLogPath = Environment.GetEnvironmentVariable("TEST_LOG_PATH");
public static readonly bool SkipCleanup = Environment.GetEnvironmentVariable("SKIP_CLEANUP") == "1" ||
Environment.GetEnvironmentVariable("SKIP_CLEANUP") == "true";
public static readonly string? WasmTestsUsingVariant = Environment.GetEnvironmentVariable("WASM_TESTS_USING_VARIANT");
public static readonly string? DebuggerTestPath = Environment.GetEnvironmentVariable("DEBUGGER_TEST_PATH");
public static readonly string? TestLogPath = Environment.GetEnvironmentVariable("TEST_LOG_PATH");
public static readonly bool SkipCleanup = GetEnvironmentVariableValue("SKIP_CLEANUP");
public static readonly bool WasmEnableThreads = GetEnvironmentVariableValue("WasmEnableThreads");

private static GetEnvironmentVariableValue(string envVariable)

Check failure on line 17 in src/mono/browser/debugger/DebuggerTestSuite/EnvironmentVariables.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release Mono_DebuggerTests_chrome)

src/mono/browser/debugger/DebuggerTestSuite/EnvironmentVariables.cs#L17

src/mono/browser/debugger/DebuggerTestSuite/EnvironmentVariables.cs(17,20): error CS1520: (NETCORE_ENGINEERING_TELEMETRY=Build) Method must have a return type
{
string? str = Environment.GetEnvironmentVariable(envVariable);
if (str is null)
return false;

if (str == "1" || bool.IsTrueStringIgnoreCase(str))
return true;

return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<_DotnetCommand Condition="'$(OS)' == 'Windows_NT'">dotnet.exe</_DotnetCommand>

<RunScriptCommand>$(_DotnetCommand) test DebuggerTestSuite/DebuggerTestSuite.dll</RunScriptCommand>
<RunScriptCommand Condition="'$(WasmEnableThreads)' == 'true'">$(RunScriptCommand) /e:WASM_TESTS_USING_VARIANT=multithreaded</RunScriptCommand>
<RunScriptCommand>$(RunScriptCommand) /e:WasmEnableThreads=$(WasmEnableThreads)</RunScriptCommand>
<RunScriptCommand>$(RunScriptCommand) &quot;-l:trx%3BLogFileName=testResults.trx&quot;</RunScriptCommand>
<RunScriptCommand Condition="'$(ContinuousIntegrationBuild)' == 'true'">$(RunScriptCommand) &quot;-l:console%3BVerbosity=normal&quot;</RunScriptCommand>

Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ a worker thread will use `async_run_in_main_thread` to queue up work for the mai

To run the debugger tests in the runtime [built with enabled support for multi-threading](#building-the-runtime) we use:
```
dotnet test src/mono/wasm/debugger/DebuggerTestSuite -e RuntimeConfiguration=Debug -e Configuration=Debug -e DebuggerHost=chrome -e WasmEnableThreads=true -e WASM_TESTS_USING_VARIANT=multithreaded
dotnet test src/mono/wasm/debugger/DebuggerTestSuite -e RuntimeConfiguration=Debug -e Configuration=Debug -e DebuggerHost=chrome -e WasmEnableThreads=true
```

## JS interop on dedicated threads ##
Expand Down
Loading