Skip to content

Disable parallel mode for test collections and reenable flaky tests. #8772

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

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1fa6255
Disable parallel mode for test collections.
dreddy-work Mar 9, 2023
f299cdf
Disable.
dreddy-work Mar 9, 2023
794fe5e
Fix Cursor dispose
dreddy-work Mar 10, 2023
de3a08d
Fix Cursor test.
dreddy-work Mar 11, 2023
7ed3b66
Add delay to InputSimulator action.
dreddy-work Mar 11, 2023
cf597ef
Capture Native LoadCursor failure.
dreddy-work Mar 11, 2023
c45ab3a
add dianostic
dreddy-work Mar 11, 2023
b21e4fb
loging.
dreddy-work Mar 11, 2023
1f9fdce
build issue.
dreddy-work Mar 11, 2023
b9e066c
log
dreddy-work Mar 11, 2023
7ffeed1
capture other cases that may fail to create Handle.
dreddy-work Mar 11, 2023
9ccf82e
Block `hsplit.cur` and `vsplit.cur` , given they are static and the d…
dreddy-work Mar 11, 2023
385c05d
Remove diagnostics.
dreddy-work Mar 11, 2023
f5b8e37
update xlf.
dreddy-work Mar 11, 2023
e12f20f
Iter1: Reenable flaky tests.
dreddy-work Mar 12, 2023
33e11d8
Add delay for missing InputSimulator actions.
dreddy-work Mar 13, 2023
231aa75
Iteration2: Enable remaining tests from the linked Epic.
dreddy-work Mar 13, 2023
efa7e28
Experiment with `DoEvents()` instead of sleep/delay.
dreddy-work Mar 13, 2023
d8c2134
Move xunit.runner.jason to build property.
dreddy-work Mar 13, 2023
3da3b52
Exclude consistant failures.
dreddy-work Mar 14, 2023
8a558d8
Address feedback and expriment with centralized delay.
dreddy-work Mar 14, 2023
339ef59
Keeping the delay back to every input.
dreddy-work Mar 14, 2023
1029b7d
Add retry count
dreddy-work Mar 14, 2023
9537d7e
Change retry count.
dreddy-work Mar 14, 2023
0e43923
Tooltip activation time reset back to original.
dreddy-work Mar 14, 2023
41d72c2
Remove test code.
dreddy-work Mar 14, 2023
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
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<EnableTrimAnalyzer Condition="$(IsTestProject) or $(IsAnalyzerProject) or $(MSBuildProjectDirectory.Contains('\tests\'))">false</EnableTrimAnalyzer>
</PropertyGroup>

<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a good place to have a comment for our re-parallelization tracking issue.

<XUnitCoreSettingsFile>$(RepositoryEngineeringDir)xunit.runner.json</XUnitCoreSettingsFile>
</PropertyGroup>

<!--
Set assembly version to align with major and minor version, as for the patches and revisions should be manually
updated per assembly if it is serviced.
Expand Down
5 changes: 5 additions & 0 deletions eng/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"maxParallelThreads": 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making everything serial should have a follow up issue for tracking if it doesn't already. It is unfortunate that we can't add comments in json. Doing this will facilitate adding poorly written tests making it harder and harder to go back to parallel testing.

"parallelizeTestCollections": false,
"re-run-failed-tests": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
<!-- workaround for https://github.com/dotnet/sdk/issues/3254 -->
<Reference Include="$(BaseOutputPath)..\System.Drawing.Facade\$(Configuration)\$(TargetFramework)\System.Drawing.dll" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
<ProjectReference Include="..\..\..\..\System.Windows.Forms\tests\IntegrationTests\System.Windows.Forms.IntegrationTests.Common\System.Windows.Forms.IntegrationTests.Common.csproj" />
<ProjectReference Include="..\VisualBasicRuntimeTest\VisualBasicRuntimeTest.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
<ItemGroup>
<ProjectReference Include="..\..\..\src\Microsoft.VisualBasic.Facade.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
<ProjectReference Include="..\..\..\System.Windows.Forms.Primitives\tests\TestUtilities\System.Windows.Forms.Primitives.TestUtilities.csproj" />
<ProjectReference Include="..\..\src\Microsoft.VisualBasic.Facade.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@
<HintPath>$(ArtifactsBinDir)\AxHosts\$(Configuration)\net472\Interop.WMPLib.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@
<ItemGroup>
<ProjectReference Include="..\TestUtilities\System.Windows.Forms.Primitives.TestUtilities.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ internal MockCursor(PCWSTR nResourceId)

public void Dispose()
{
if (!_handle.IsNull)
if (!_handle.IsNull && _ownHandle)
{
if (_ownHandle)
{
PInvoke.DestroyCursor(_handle);
}

PInvoke.DestroyCursor(_handle);
_handle = HCURSOR.Null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
<ItemGroup>
<ProjectReference Include="..\TestUtilities\System.Windows.Forms.Primitives.TestUtilities.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

namespace System.Windows.Forms.Tests
{
[Collection(nameof(SynchronousCollection))]
public class LocalAppContextSwitchesTest
{
private void ResetLocalSwitches(dynamic testAccessor)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
<ItemGroup>
<ProjectReference Include="..\..\src\System.Windows.Forms.PrivateSourceGenerators.csproj" />
</ItemGroup>

</Project>
5 changes: 4 additions & 1 deletion src/System.Windows.Forms/src/Resources/SR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -6961,4 +6961,7 @@ Stack trace where the illegal operation occurred was:
<data name="InvalidArgumentType" xml:space="preserve">
<value>Argument '{0}' must be of type '{1}'.</value>
</data>
</root>
<data name="FailedToLoadCursor" xml:space="preserve">
<value>Failed to load cursor. Error '{1}'.</value>
</data>
</root>
5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions src/System.Windows.Forms/src/System/Windows/Forms/Cursor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace System.Windows.Forms
public sealed class Cursor : IDisposable, ISerializable, IHandle<HICON>, IHandle<HANDLE>
{
private static Size s_cursorSize = Size.Empty;

private readonly byte[]? _cursorData;
private HCURSOR _handle;
private bool _ownHandle = true;
Expand All @@ -39,6 +38,10 @@ internal unsafe Cursor(PCWSTR nResourceId)
_ownHandle = false;
_resourceId = nResourceId;
_handle = PInvoke.LoadCursor((HINSTANCE)0, nResourceId);
if (_handle.IsNull)
{
throw new Win32Exception(string.Format(SR.FailedToLoadCursor, Marshal.GetLastWin32Error()));
}
}

/// <summary>
Expand Down Expand Up @@ -145,6 +148,7 @@ public IntPtr Handle
get
{
ObjectDisposedException.ThrowIf(_handle.IsNull, this);

return (nint)_handle;
}
}
Expand Down Expand Up @@ -222,13 +226,9 @@ public void Dispose()

private void Dispose(bool disposing)
{
if (!_handle.IsNull)
if (!_handle.IsNull && _ownHandle)
{
if (_ownHandle)
{
PInvoke.DestroyCursor(_handle);
}

PInvoke.DestroyCursor(_handle);
_handle = HCURSOR.Null;
}
}
Expand Down Expand Up @@ -430,6 +430,11 @@ private unsafe void LoadPicture(IStream.Interface stream, string paramName)
picSize.Height,
IMAGE_FLAGS.LR_DEFAULTCOLOR).Value;

if (_handle.IsNull)
{
throw new Win32Exception(string.Format(SR.FailedToLoadCursor, Marshal.GetLastWin32Error()));
}

_ownHandle = true;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
<ProjectReference Include="..\..\..\src\System.Windows.Forms.csproj" />
<ProjectReference Include="..\WinformsControlsTest\WinformsControlsTest.csproj" />
</ItemGroup>

</Project>
Loading