dotnet / dotnet/winforms

[Flaky Test] System.Windows.Forms.Tests.Text.FontMetrics.Font_MeasureText

Open
#8,612 0 comments 0 reactions 0 assignees View on GitHub
test-bug
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### Test

System.Windows.Forms.Tests.Text.FontMetrics.Font_MeasureText

### Issue description

System.Windows.Forms.Tests.Text.FontMetrics.Font_MeasureText test fails with following exception and call stack in debug mode. Need to be investigated further before enabling it back. It seems runtime has assertion check on refcount that is bailing out in debug builds.

We observed this specifically on arm64 build but might have been happening on X86/64 as well.

```CS

Process terminated. Assertion Failed
at System.Windows.Forms.RefCountedCache`3.g__Clean|8_2() in /_/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/RefCountedCache.cs:line 176
at System.Windows.Forms.RefCountedCache`3.g__Add|8_1(TKey key) in /_/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/RefCountedCache.cs:line 128
at System.Windows.Forms.RefCountedCache`3.GetEntry(TKey key) in /_/src/System.Windows.Forms.Primitives/src/System/Windows/Forms/RefCountedCache.cs:line 82
at System.Windows.Forms.FontCache.GetEntry(ValueTuple`2 key) in /_/src/System.Windows.Forms/src/System/Windows/Forms/Internal/Gdi/FontCache.cs:line 40
at System.Windows.Forms.FontCache.GetEntry(Font font, FONT_QUALITY quality) in /_/src/System.Windows.Forms/src/System/Windows/Forms/Internal/Gdi/FontCache.cs:line 34
at System.Windows.Forms.GdiCache.GetHFONT(Font font, FONT_QUALITY quality) in /_/src/System.Windows.Forms/src/System/Windows/Forms/Internal/Gdi/GdiCache.cs:line 87
at System.Windows.Forms.Tests.Text.FontMetrics.Font_MeasureText(String family, Single size, Size proposedSize, UInt32 dt, Size expected) in /_/src/System.Windows.Forms/tests/UnitTests/Text/FontMetrics.cs:line 86
at InvokeStub_FontMetrics.Font_MeasureText(Object, Object, IntPtr*)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.