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

Try to fix a time-sensitive thread pool test #66765

Closed
wants to merge 5 commits into from
Closed

Conversation

kouvel
Copy link
Member

@kouvel kouvel commented Mar 17, 2022

I guess the test may occasionally time out if it's running in parallel with other tests, depending on what those other tests are doing. Subscribed to thread adjustment events to see if progress is being made to extend the timeout.

Hopefully fixes #66852

@ghost
Copy link

ghost commented Mar 17, 2022

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

Issue Details

I guess the test may occasionally time out if it's running in parallel with other tests, depending on what those other tests are doing. Subscribed to thread adjustment events to see if progress is being made to extend the timeout.

Hopefully fixes #66755

Author: kouvel
Assignees: kouvel
Labels:

area-System.Threading

Milestone: 7.0.0

@am11
Copy link
Member

am11 commented Mar 19, 2022

If parallelization is the root-cause of failure, there is DisableTestParallelization behavior to disable it, e.g.

[assembly: CollectionBehavior(DisableTestParallelization = true, MaxParallelThreads = 1)]
(requires <Compile Include="$(CommonTestPath)TestUtilities\System\DisableParallelizationPerAssembly.cs" /> in csproj)

@kouvel
Copy link
Member Author

kouvel commented Mar 22, 2022

If parallelization is the root-cause of failure, there is DisableTestParallelization behavior to disable it

Does that disable parallelization only for this test assembly, or does it also disable parallelization between tests from different assemblies?

@am11
Copy link
Member

am11 commented Mar 22, 2022

I am not sure but I think on helix, we only execute one test assembly at a time? @adamsitnik might know the definite answer.

@adamsitnik
Copy link
Member

I am not sure but I think on helix, we only execute one test assembly at a time?

Afaik this is true (cc @ericstj who is our ultimate source of truth).

DisableParallelizationPerAssembly

by using it it's ensured that all tests in given assembly are run sequentially.

DisableParallelization runs all other tests in parallel first, and then at the end sequentially tests from types marked with this attribute (this is typically what I am using).

@agocke
Copy link
Member

agocke commented Mar 22, 2022

@kouvel What's the status of this change? Will it be done today? nvm, missed that the test was disabled

@hoyosjs
Copy link
Member

hoyosjs commented Mar 22, 2022

Helix assemblies for libraries do run on a project basis: https://helix.dot.net/api/jobs/f8d1561b-e515-4958-8114-6d2a0900b0de/workitems?api-version=2019-06-17 each one of those runs separately.

I guess the test may occasionally time out if it's running in parallel with other tests, depending on what those other tests are doing. Subscribed to thread adjustment events to see if progress is being made to extend the timeout.

Hopefully fixes dotnet#66755
@ericstj
Copy link
Member

ericstj commented Mar 22, 2022

Afaik this is true (cc @ericstj who is our ultimate source of truth).

Ha! I'm not the source of truth -- the source is. I just read it. It can change at any time so I go back and re-read it. Sometimes I don't read the source and instead read the test logs if I don't trust my eyeball-debugger. cc @dotnet/runtime-infrastructure

In libraries we don't parallelize at the assembly level. Each test assembly gets launched once and helix only runs one job at a time on the machine. You can examine how that works here:

<GenerateRunScript RunCommands="@(RunScriptCommands)"

https://github.com/dotnet/runtime/search?q=RunScriptCommand

The coreclr tests are a little different. They intentionally parallelize (and that actually has caused problems). You can see that here:

<XUnitWrapperGrouping Include="$(TestBinDir)baseservices\compilerservices\*.XUnitWrapper.dll;
$(TestBinDir)baseservices\exceptions\*.XUnitWrapper.dll;
$(TestBinDir)baseservices\multidimmarray\*.XUnitWrapper.dll;
$(TestBinDir)baseservices\TieredCompilation\*.XUnitWrapper.dll;
$(TestBinDir)baseservices\typeequivalence\*.XUnitWrapper.dll;
$(TestBinDir)baseservices\varargs\*.XUnitWrapper.dll;
$(TestBinDir)CoreMangLib\**\*.XUnitWrapper.dll;
$(TestBinDir)Exceptions\**\*.XUnitWrapper.dll;
$(TestBinDir)GC\**\*.XUnitWrapper.dll;
$(TestBinDir)hosting\**\*.XUnitWrapper.dll;
$(TestBinDir)ilasm\**\*.XUnitWrapper.dll;
$(TestBinDir)Loader\**\*.XUnitWrapper.dll;
$(TestBinDir)managed\**\*.XUnitWrapper.dll;
$(TestBinDir)readytorun\**\*.XUnitWrapper.dll;
$(TestBinDir)reflection\**\*.XUnitWrapper.dll;
$(TestBinDir)Regressions\**\*.XUnitWrapper.dll;
$(TestBinDir)tracing\**\*.XUnitWrapper.dll"
Exclude="$(TestBinDir)Loader\classloader\Loader.classloader.XUnitWrapper.dll">
<PayloadGroup>PayloadGroup0</PayloadGroup>
</XUnitWrapperGrouping>

<XUnitWrapperDlls>$([System.String]::Join(' ', $([System.IO.Directory]::GetFiles(%(FullPath), '*.XUnitWrapper.dll', SearchOption.AllDirectories))).Replace($([MSBuild]::EnsureTrailingSlash(%(FullPath))),''))</XUnitWrapperDlls>

@kouvel
Copy link
Member Author

kouvel commented Mar 22, 2022

Thanks all! I'll try disabling parallelization for this test.

@kouvel
Copy link
Member Author

kouvel commented Mar 31, 2022

Still failing and appears to not be a parallelization issue. I can repro the issue on the latest macOS, seems to be an issue with GC.GetGCMemoryInfo() reporting that the memory load is >= the memory limit. Considering that it started failing somewhat suddenly, I suspect it has something to do with GC or OS changes. I'll file a separate issue.

@kouvel kouvel closed this Mar 31, 2022
@kouvel kouvel deleted the TestFix branch March 31, 2022 02:59
@ghost ghost locked as resolved and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Threadpool test CooperativeBlockingCanCreateThreadsFaster failing on Mac
6 participants