Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] ICommand Unit Test Race Condition #1075

@TheCodeTraveler

Description

@TheCodeTraveler

Description

There exists a race condition in the IAsyncCommand and IAsyncValueCommand unit tests that is causing the the tests to timeout.

The timeout happens in tests like these where we are verifying that ICommand.CanExecuteChanged fires.

An example of the Unit Tests timing out can be seen in this CI build; the Unit Tests on .NET Framework never completed, causing the entire Unit Test suite to timeout after an hour:
https://github.com/xamarin/XamarinCommunityToolkit/pull/1005/checks?check_run_id=2100776335

Right now, this race condition appears to be only happening to Unit Tests running on .NET Framework; the Unit Tests running on .NET Core 2.1 and .NET Core 3.1 continue to pass successfully.

I'll start by adding a timeout to these unit tests to ensure they fail after a few seconds instead of running indefinitely; [Fact(Timeout = 3000)] will ensure it fails after 3 seconds, which should be more than enough time for it to complete successfully.

Once we now which tests are failing, I can dig deeper into, and fix, the race condition causing the failure.

Metadata

Metadata

Labels

a/CommandsThe issue/PR is related to Command and/or AsyncCommandbugSomething isn't working. Breaky break.under-investigationActively under investigation by a team member.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions