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

[MT][browser] System.Threading.Tasks.Tests.TaskContinueWhenAnyTests.RunContinueWhenAnyTests fails #91550

Closed
ilonatommy opened this issue Sep 4, 2023 · 7 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono disabled-test The test is disabled in source code against the issue
Milestone

Comments

@ilonatommy
Copy link
Member

After enabling all MT library tests (#91536)

[FAIL] System.Threading.Tasks.Tests.TaskContinueWhenAnyTests.RunContinueWhenAnyTests
 RunContinueWhenAnyTests: > FAILED! continuation.Wait() should throw exception iff preCanceledToken
 Expected: True
 Actual:   False
   at System.Threading.Tasks.Tests.TaskContinueWhenAnyTests.RunContinueWhenAnyTests()
    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
@ilonatommy ilonatommy added arch-wasm WebAssembly architecture disabled-test The test is disabled in source code against the issue area-Build-mono area-VM-threading-mono labels Sep 4, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Sep 4, 2023
@ghost
Copy link

ghost commented Sep 4, 2023

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

Issue Details

After enabling all MT library tests (#91536)

[FAIL] System.Threading.Tasks.Tests.TaskContinueWhenAnyTests.RunContinueWhenAnyTests
 RunContinueWhenAnyTests: > FAILED! continuation.Wait() should throw exception iff preCanceledToken
 Expected: True
 Actual:   False
   at System.Threading.Tasks.Tests.TaskContinueWhenAnyTests.RunContinueWhenAnyTests()
    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Author: ilonatommy
Assignees: -
Labels:

arch-wasm, disabled-test, area-Build-mono, area-VM-threading-mono

Milestone: -

@radical radical added this to the 9.0.0 milestone Sep 5, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Sep 5, 2023
@pavelsavara pavelsavara self-assigned this Nov 8, 2023
@radekdoulik
Copy link
Member

This is still valid issue.

Interestingly the test passes when run with the other tests.

When I run it separately, it deadlocks with:

  info: Initializing dotnet version 9.0.0-dev commit hash 75dc1b3cd2a92df13fdc383212d1c2d8a7928f19
  info: Discovering: System.Threading.Tasks.Tests.dll (method display = ClassAndMethod, method display options = None)
  info: Discovered:  System.Threading.Tasks.Tests.dll (found 1 of 787 test cases)
  info: Using random seed for test cases: 304684785
  info: Using random seed for collections: 304684785
  info: Starting:    System.Threading.Tasks.Tests.dll
  warn: Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread
  warn: MONO_WASM [0xf3d3c-main]: Failed to find loaded WebWorker, this may deadlock. Please increase the pthreadPoolSize.

@pavelsavara
Copy link
Member

pavelsavara commented Jan 25, 2024

how many threads we think it should use ? I see something like (2^6)*3 tasks being created, some of them long running.

@lewing lewing assigned maraf and unassigned pavelsavara Jan 25, 2024
@maraf
Copy link
Member

maraf commented Feb 8, 2024

Current failure is

  fail: [FAIL] System.Threading.Tasks.Tests.TaskContinueWhenAnyTests.RunContinueWhenAnyTests
  info: System.PlatformNotSupportedException : Blocking wait is not supported on the JS interop threads.
  info:    at System.Threading.Thread.AssureBlockingPossible() in C:\Development\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs:line 683
  info:    at System.Threading.Monitor.Wait(Object obj, Int32 millisecondsTimeout) in C:\Development\dotnet\runtime\src\mono\System.Private.CoreLib\src\System\Threading\Monitor.Mono.cs:line 81
  info:    at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) in C:\Development\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs:line 573
  info:    at System.Threading.Tasks.Task.SpinThenBlockingWait(Int32 millisecondsTimeout, CancellationToken cancellationToken) in C:\Development\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 3068
  info:    at System.Threading.Tasks.Task.InternalWaitCore(Int32 millisecondsTimeout, CancellationToken cancellationToken) in C:\Development\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 3003
  info:    at System.Threading.Tasks.Task.InternalWait(Int32 millisecondsTimeout, CancellationToken cancellationToken) in C:\Development\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2962
  info:    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) in C:\Development\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2764
  info:    at System.Threading.Tasks.Task.Wait() in C:\Development\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2623
  info:    at System.Threading.Tasks.Tests.TaskContinueWhenAnyTests.RunContinueWhenAnyTests() in C:\Development\dotnet\runtime\src\libraries\System.Runtime\tests\System.Threading.Tasks.Tests\Task\TaskContinueWhenAnyTests.cs:line 93
  info:    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in C:\Development\dotnet\runtime\src\mono\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.Mono.cs:line 22
  info:    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in C:\Development\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs:line 57
  info: Finished:    System.Threading.Tasks.Tests.dll

@pavelsavara
Copy link
Member

Right now, we are invoking the test on the thread pool thread. And so I wonder how did we get to UI thread.

cc @radekdoulik

@pavelsavara
Copy link
Member

let's re-test with latest main

@ilonatommy
Copy link
Member Author

This is not blocked on main. Closing.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono disabled-test The test is disabled in source code against the issue
Projects
None yet
Development

No branches or pull requests

5 participants