cc @rokonec (who pointed this out)
Context
TaskRegistry was found to be dependent on the order of items in one of it's backing dictionary field (#8861)
There are existing unit tests that test for exact equality of dictionaries (including order of data): https://github.com/dotnet/msbuild/blob/main/src/Shared/UnitTests/ObjectModelHelpers.cs#L1262. This shows a possibility that other internal structures/algos might be dependent on the implicit order.
Suggestion
These tests should be updated to test without reliance on order (btw. FluentAssertions should replace need for custom method https://fluentassertions.com/dictionaries/).
However before removing the order assertion - all the tested structures should be inspected, if there is not any code that depends on the implicit ordering of dictionary.
cc @rokonec (who pointed this out)
Context
TaskRegistrywas found to be dependent on the order of items in one of it's backing dictionary field (#8861)There are existing unit tests that test for exact equality of dictionaries (including order of data): https://github.com/dotnet/msbuild/blob/main/src/Shared/UnitTests/ObjectModelHelpers.cs#L1262. This shows a possibility that other internal structures/algos might be dependent on the implicit order.
Suggestion
These tests should be updated to test without reliance on order (btw. FluentAssertions should replace need for custom method https://fluentassertions.com/dictionaries/).
However before removing the order assertion - all the tested structures should be inspected, if there is not any code that depends on the implicit ordering of dictionary.