dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.56k stars 4.55k forks source link

[browser][MT] TimeZoneInfoTests.ChangeLocalTimeZone not thread safe #101166

Open pavelsavara opened 2 months ago

pavelsavara commented 2 months ago

Log

[20:36:08] info: [FAIL] System.Tests.TimeZoneInfoTests.ChangeLocalTimeZone(id: "America/Buenos_Aires")
[20:36:08] info: Assert.Equal() Failure: Strings differ
[20:36:08] info:            ↓ (pos 0)
[20:36:08] info: Expected: "-03"
[20:36:08] info: Actual:   "UTC"
[20:36:08] info:            ↑ (pos 0)
[20:36:08] info:    at System.Tests.TimeZoneInfoTests.ChangeLocalTimeZone(String id)
[20:36:08] info:    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[20:36:08] info:    at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=645791 Build error leg or test failing:

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "[FAIL] System.Tests.TimeZoneInfoTests.ChangeLocalTimeZone",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=645791 Error message validated: [[FAIL] System.Tests.TimeZoneInfoTests.ChangeLocalTimeZone] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 4/17/2024 7:32:57 AM UTC

Report

Build Definition Test Pull Request
646615 dotnet/runtime WasmTestOnBrowser-System.Runtime.Tests.WorkItemExecution dotnet/runtime#100094
646414 dotnet/runtime WasmTestOnBrowser-System.Runtime.Tests.WorkItemExecution dotnet/runtime#101168
645791 dotnet/runtime WasmTestOnBrowser-System.Runtime.Tests.WorkItemExecution dotnet/runtime#101138

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 3 3
dotnet-policy-service[bot] commented 2 months ago

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

lewing commented 2 months ago

I think we can just skip it on MT for now, its testing that the startup TZ selection works but the mechanism it is using is inherently unsafe in the MT context.

mkhamoyan commented 5 days ago

As discussed in https://github.com/dotnet/runtime/pull/103953 we need to add additional test case to observe a single non-UI thread performing the change and examining the slow propagation of this change. The objective is to understand the underlying mechanism in emscripten and identify the necessary synchronization in mono to prevent issues like "read after write hazards". This approach will provide clearer insights into the root cause.