Skip to content

[BUG] Tests are Fragile #3187

@matt-goldman

Description

@matt-goldman

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

Tests and builds have some fragility and and do not seem to repeatedly, reliably run with deterministic outcomes.

It looks like there are a couple of issues converging to cause this problem. The first is race conditions in tests and benchmarks, particularly around parallel benchmark runs that attempt to build artifacts that are locked by other runs. The second is that bindable properties created with the source generator were using ConfigureAwait(false) which combined with async void was exacerbating the above mentioned race conditions.

Note that I have investigated only the apparent failures and don't have a good understanding of the full context, so will appreciate some input and guidance here.

Expected Behavior

Tests should deterministically pass or fail based on expected conditions, not ephemeral environmental conditions.

Steps To Reproduce

  1. Open a PR with some code changes
  2. Allow tests and builds to run
  3. Re-run tests and builds and compare results

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui

Environment

- .NET MAUI CommunityToolkit: 14.1.0
- OS: Windos and macOS
- .NET MAUI: 10.0.100

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions