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

System.Threading.Tasks.Extensions tests hanging on WASM #38931

Closed
mdh1418 opened this issue Jul 8, 2020 · 3 comments · Fixed by #40278
Closed

System.Threading.Tasks.Extensions tests hanging on WASM #38931

mdh1418 opened this issue Jul 8, 2020 · 3 comments · Fixed by #40278
Assignees
Labels
Milestone

Comments

@mdh1418
Copy link
Member

mdh1418 commented Jul 8, 2020

Several tests from System.Threading.Tasks.Extensions are hanging when running the test suite on Browser WebAssembly.

It is suspected that "incomplete" tests in xharness lead to an infinite loop in the threadpool pump loop. #38815 (comment)

[SKIP] System.Threading.Tasks.Tests.AsyncValueTaskMethodBuilderTests.AwaitTasksAndValueTasks_InTaskAndValueTaskMethods
[SKIP] System.Threading.Tasks.Tests.AsyncValueTaskMethodBuilderTests.Generic_ConcurrentBuilders_WorkCorrectly
[SKIP] System.Threading.Tasks.Tests.AsyncValueTaskMethodBuilderTests.NonGeneric_ConcurrentBuilders_WorkCorrectly
[SKIP] System.Threading.Tasks.Sources.Tests.ManualResetValueTaskSourceTests.SetException_AfterOnCompleted_ResultAvailableAsynchronously
[SKIP] System.Threading.Tasks.Sources.Tests.ManualResetValueTaskSourceTests.AsyncEnumerable_Success
[SKIP] System.Threading.Tasks.Sources.Tests.ManualResetValueTaskSourceTests.SetResult_AfterOnCompleted_ResultAvailableAsynchronously
[SKIP] System.Threading.Tasks.Sources.Tests.ManualResetValueTaskSourceTests.ReuseInstanceWithResets_Success
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.Generic_CreateFromValueTaskSource_Canceled(sync: False)
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.Generic_CreateFromValueTaskSource_Success(sync: False)
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.Generic_CreateFromValueTaskSource_Faulted(sync: False)
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.Generic_CreateFromTask_Await_Normal
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.Generic_CreateFromValueTaskSource_Await_Normal
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.CreateFromValueTaskSource_Await_Normal
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.Generic_Awaiter_ContinuesOnCapturedContext
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.NonGeneric_CreateFromTask_Await_Normal
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.NonGeneric_ConfiguredAwaiter_ContinuesOnCapturedContext
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.NonGeneric_CreateFromValueTaskSource_Canceled(sync: False)
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.NonGeneric_CreateFromValueTaskSource_Faulted(sync: False)
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.NonGeneric_CreateFromValueTaskSource_Success(sync: False)
[SKIP] System.Threading.Tasks.Tests.ValueTaskTests.Generic_ConfiguredAwaiter_ContinuesOnCapturedContext
@mdh1418 mdh1418 added the arch-wasm WebAssembly architecture label Jul 8, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Threading untriaged New issue has not been triaged by the area owner labels Jul 8, 2020
@ghost
Copy link

ghost commented Jul 22, 2020

Tagging subscribers to this area: @tarekgh
See info in area-owners.md if you want to be subscribed.

@marek-safar marek-safar added this to the Future milestone Jul 31, 2020
@marek-safar
Copy link
Contributor

Is this xharness issue?

/cc @akoeplinger

@akoeplinger
Copy link
Member

I looked at it and yeah it's kind of an xharness issue. We only pump the threadpool but we don't pump the timer queue inside the xharness runner, so in the case of Task.Delay() it'll schedule a callback on the timer queue and that will never happen which leads to the infinite loop waiting for the test to finish.

I'll know how to fix it.

@akoeplinger akoeplinger self-assigned this Aug 3, 2020
@akoeplinger akoeplinger removed the untriaged New issue has not been triaged by the area owner label Aug 3, 2020
akoeplinger added a commit to akoeplinger/xharness that referenced this issue Aug 3, 2020
premun pushed a commit to dotnet/xharness that referenced this issue Aug 3, 2020
akoeplinger added a commit to akoeplinger/runtime that referenced this issue Aug 3, 2020
We only pumped the threadpool but we didn't pump the timer queue inside the xharness runner, so in the case of Task.Delay() it'll schedule a callback on the timer queue and that will never happen which leads to the infinite loop waiting for the test to finish.
To fix that we call an internal method to pump the timer queue like we do for the threadpool.

Requires an xharness bump to include dotnet/xharness#290

Fixes dotnet#38931
akoeplinger added a commit that referenced this issue Aug 4, 2020
* WASM: Pump timer queue in xharness when running unit tests

We only pumped the threadpool but we didn't pump the timer queue inside the xharness runner, so in the case of Task.Delay() it'll schedule a callback on the timer queue and that will never happen which leads to the infinite loop waiting for the test to finish.
To fix that we call an internal method to pump the timer queue like we do for the threadpool.

Requires an xharness bump to include dotnet/xharness#290

Fixes #38931

* Don't nullref if no timers were started
Jacksondr5 pushed a commit to Jacksondr5/runtime that referenced this issue Aug 10, 2020
)

* WASM: Pump timer queue in xharness when running unit tests

We only pumped the threadpool but we didn't pump the timer queue inside the xharness runner, so in the case of Task.Delay() it'll schedule a callback on the timer queue and that will never happen which leads to the infinite loop waiting for the test to finish.
To fix that we call an internal method to pump the timer queue like we do for the threadpool.

Requires an xharness bump to include dotnet/xharness#290

Fixes dotnet#38931

* Don't nullref if no timers were started
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants