-
Notifications
You must be signed in to change notification settings - Fork 971
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
Flaky test: cursorconverter_convertto_unknowntoinstancedescriptor_throwsnotsupportedexception #8373
Comments
Here is the exception from the build. The winforms/src/System.Windows.Forms/src/System/Windows/Forms/CursorConverter.cs Lines 78 to 85 in c872b6e
This is the failing test: winforms/src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/CursorConverterTests.cs Lines 113 to 118 in 81774ab
So somehow during debug locally the CursorConverter throws Error message
Stack Trace
|
Ok I have been digging into this a bit more. The code hits this if block and checks each property on winforms/src/System.Windows.Forms/src/System/Windows/Forms/CursorConverter.cs Lines 124 to 134 in c872b6e
For this test it would usually exhaust the search and hit the base case. But occasionally in CI, it errors out when accessing the Its failing with the following:
The associated constructor for https://learn.microsoft.com/en-us/windows/win32/api/objidl/nf-objidl-ipersiststream-load I believe the issue might be with the constructor and the stream parameters position. We haven't checked its at 0. |
I wrote a test to pass a stream with a position other than zero to validate this, I get an [Fact]
public void CursorConverter_ConvertTo_Test()
{
Type type = typeof(Cursor);
var stream = type.Module.Assembly.GetManifestResourceStream(type, "hsplit.cur");
stream.Position = 5;
Cursor cursor = new Cursor(stream);
} Stack trace:
|
The first step to stabilize cursor tests might be to Dispose of all cursor objects that the test news up. Next might be to make them |
Suggestion from @JeremyKuhne - see what other tests are using the same image files We shouldn't access the same files from different threads. Maybe create dedicated images for each test? Then we don't have to use WinformsFact. |
Runfo Tracking Issue: Flaky test: cursorconverter_convertto_unknowntoinstancedescriptor_throwsnotsupportedexception
Build Result Summary
The text was updated successfully, but these errors were encountered: