Skip to content

Add test for PR 13320 #13342

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

Merged
merged 9 commits into from
Jun 19, 2025
Merged

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Apr 22, 2025

@LeafShi1
Copy link
Member Author

LeafShi1 commented Apr 23, 2025

The test failed due to the control.handle is not released when executing DataGridView.PerformLayoutPrivate

The call stack in .net project:
image

System.Windows.Forms.dll!System.Windows.Forms.DataGridView.PerformLayoutPrivate(bool useRowShortcut, bool computeVisibleRows, bool invalidInAdjustFillingColumns, bool repositionEditingControl) Line 19749	C#
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.ResetUIState(bool useRowShortcut, bool computeVisibleRows) Line 25909	C#
System.Windows.Forms.dll!System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged_PreNotification(System.ComponentModel.CollectionChangeAction cca, int rowIndex, int rowCount, ref System.Windows.Forms.DataGridViewRow dataGridViewRow, bool changeIsInsertion) Line 2080	C#
System.Windows.Forms.dll!System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged(System.ComponentModel.CollectionChangeEventArgs e, int rowIndex, int rowCount, bool changeIsDeletion, bool changeIsInsertion, bool recreateNewRow, System.Drawing.Point newCurrentCell) Line 1945	C#
System.Windows.Forms.dll!System.Windows.Forms.DataGridViewRowCollection.ClearInternal(bool recreateNewRow) Line 828	C#
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.RefreshColumnsAndRows() Line 25413	C#
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.OnDataSourceChanged(System.EventArgs e) Line 14900	C#
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.DataSource.set(object value) Line 1956	C#
System.Windows.Forms.dll!System.Windows.Forms.DataGridView.OnDataSourceDisposed(object sender, System.EventArgs e) Line 14915	C#
System.ComponentModel.Primitives.dll!System.ComponentModel.Component.Dispose(bool disposing)	Unknown
System.Windows.Forms.dll!System.Windows.Forms.BindingSource.Dispose(bool disposing) Line 609	C#
System.ComponentModel.Primitives.dll!System.ComponentModel.Component.Dispose()	Unknown
System.ComponentModel.TypeConverter.dll!System.ComponentModel.Container.Dispose(bool disposing)	Unknown
System.ComponentModel.TypeConverter.dll!System.ComponentModel.Container.Dispose()	Unknown
ScratchProject.dll!ScratchProject.DataGridViewDialog.Dispose(bool disposing) Line 18	C#
System.ComponentModel.Primitives.dll!System.ComponentModel.Component.Dispose()	Unknown
ScratchProject.dll!ScratchProject.Form1.button1_Click(object sender, System.EventArgs e) Line 21	C#

The call stack in .NET Framework:
image

DataGridViewColumnCollection.get_Item(Int32 index) line 81
DataGridView.PositionEditingControl(Boolean setLocation, Boolean setSize, Boolean setFocus) line 19828
DataGridView.PerformLayoutPrivate(Boolean useRowShortcut, Boolean computeVisibleRows, Boolean invalidInAdjustFillingColumns, Boolean repositionEditingControl) line 19745
DataGridView.ResetUIState(Boolean useRowShortcut, Boolean computeVisibleRows) line 25911
DataGridViewRowCollection.OnCollectionChanged_PreNotification(CollectionChangeAction cca, Int32 rowIndex, Int32 rowCount, DataGridViewRow& dataGridViewRow, Boolean changeIsInsertion) line 2080
DataGridViewRowCollection.OnCollectionChanged(CollectionChangeEventArgs e, Int32 rowIndex, Int32 rowCount, Boolean changeIsDeletion, Boolean changeIsInsertion, Boolean recreateNewRow, Point newCurrentCell) line 1945
DataGridViewRowCollection.ClearInternal(Boolean recreateNewRow) line 828
DataGridView.RefreshColumnsAndRows() line 25415
DataGridView.OnDataSourceChanged(EventArgs e) line 14901
DataGridView.set_DataSource(Object value) line 1956
DataGridView.OnDataSourceDisposed(Object sender, EventArgs e) line 14916
Component.Dispose(Boolean disposing)
BindingSource.Dispose(Boolean disposing) line 609
Component.Dispose()
DataGridViewTests.b__3_0(Form form2, DataGridView dataGridView) line 111
DataGridViewTests.b__3_0(Form form2, DataGridView dataGridView)
<b__0>d.MoveNext() line 317

@Tanya-Solyanik
Copy link
Contributor

@LeafShi1 - can we avoid SendKeys as well?

@LeafShi1 LeafShi1 marked this pull request as ready for review April 29, 2025 08:55
@LeafShi1 LeafShi1 requested a review from a team as a code owner April 29, 2025 08:55
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.57947%. Comparing base (a64fee1) to head (e39f49a).
Report is 36 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13342         +/-   ##
===================================================
- Coverage   76.61355%   76.57947%   -0.03409%     
===================================================
  Files           3237        3243          +6     
  Lines         639477      640152        +675     
  Branches       47319       47389         +70     
===================================================
+ Hits          489926      490225        +299     
- Misses        146030      146289        +259     
- Partials        3521        3638        +117     
Flag Coverage Δ
Debug 76.57947% <ø> (-0.03409%) ⬇️
integration 18.88255% <ø> (+0.34989%) ⬆️
production 50.96845% <ø> (-0.05453%) ⬇️
test 97.41411% <ø> (+0.00166%) ⬆️
unit 48.40507% <ø> (-0.01810%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Tanya-Solyanik Tanya-Solyanik added the waiting-author-feedback The team requires more information from the author label Apr 30, 2025
@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback The team requires more information from the author label May 8, 2025
@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label May 8, 2025
@LeafShi1 LeafShi1 force-pushed the Add-test-for-DataGridView branch from 23185b8 to f5934ca Compare May 12, 2025 07:35
@LeafShi1 LeafShi1 requested a review from JeremyKuhne May 22, 2025 02:21
@KlausLoeffelmann KlausLoeffelmann added the waiting-author-feedback The team requires more information from the author label Jun 11, 2025
@KlausLoeffelmann
Copy link
Member

Hey all,

before we push changes - can we make sure for efficiency reasons, that a command-line build (not a build inside of VS) will pass before we check in? That will at least prevent to have certain warnings or other compile errors, which would not be shown immediately in the UI.

Thanks!

@dotnet-policy-service dotnet-policy-service bot removed the waiting-author-feedback The team requires more information from the author label Jun 13, 2025
@LeafShi1 LeafShi1 requested a review from ricardobossan June 13, 2025 05:41
Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

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

All LGTM, but conflicts need to be solved.

@LeafShi1 LeafShi1 force-pushed the Add-test-for-DataGridView branch from 8a9d7a9 to 892c59a Compare June 16, 2025 06:39
@LeafShi1 LeafShi1 merged commit 08485db into dotnet:main Jun 19, 2025
8 checks passed
@dotnet-policy-service dotnet-policy-service bot removed the waiting-review This item is waiting on review by one or more members of team label Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants