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

Fix color checking from blocking and add logging #27400

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Jan 28, 2025

Description of Change

  • Wire up ILogger so we can more easily see where time is being spent if we need to
  • Fix all the "ContainsColor" methods to validate on a background thread. In theory tests should timeout if they've been running longer than 15 seconds but the contains color call was blocking the UIThread so it couldn't process the timeout
  • Change the image on the shell tab test to use a smaller image so it doesn't have to validate against as many pixels

@Copilot Copilot bot review requested due to automatic review settings January 28, 2025 12:09
@PureWeen PureWeen requested a review from a team as a code owner January 28, 2025 12:09
@PureWeen PureWeen added this to the .NET 9 SR4 milestone Jan 28, 2025
@@ -52,7 +52,7 @@ public async Task GetImageAsync(string colorHex)

var uiimage = Assert.IsType<UIImage>(drawable.Value);

uiimage.AssertContainsColor(expectedColor.ToPlatform());
await uiimage.AssertContainsColor(expectedColor.ToPlatform()).ConfigureAwait(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems the same changes are required on the Android tests:

D:\a\_work\1\s\src\Core\tests\DeviceTests\Services\ImageSource\FontImageSourceServiceTests.Android.cs(56,4): error CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [D:\a\_work\1\s\src\Core\tests\DeviceTests\Core.DeviceTests.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\src\Core\tests\DeviceTests\Services\ImageSource\FontImageSourceServiceTests.Android.cs(95,4): error CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [D:\a\_work\1\s\src\Core\tests\DeviceTests\Core.DeviceTests.csproj::TargetFramework=net9.0-android]
    8944 Warning(s)
    2 Error(s)

@PureWeen PureWeen force-pushed the fix_device_tests_add_logging branch from cff2cf6 to 824260d Compare January 28, 2025 22:12
@PureWeen PureWeen force-pushed the fix_device_tests_add_logging branch from 824260d to 4e05295 Compare January 29, 2025 16:08
@PureWeen
Copy link
Member Author

@PureWeen PureWeen merged commit b2654b2 into main Jan 31, 2025
307 of 317 checks passed
@PureWeen PureWeen deleted the fix_device_tests_add_logging branch January 31, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants