Skip to content

Investigate structures possibly dependent on order of data in Dictionaries #8937

@JanKrivanek

Description

@JanKrivanek

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions