ModelBuilder tests failing on PG because of problematic set comparison
As part of syncing EFCore.PG for 9.0.0-preview.1, I'm running into failures e.g. in Access_mode_can_be_overridden_at_entity_and_property_levels:
Assert.Equal() Failure: During comparison of two collections, GetHashCode was called, but only a comparison function was provided. This typically indicates trying to compare two sets with an item comparison function, which is not supported. For more information, see https://xunit.net/docs/hash-sets-vs-linear-containers
at Microsoft.EntityFrameworkCore.TestUtilities.ModelAsserter.AssertEqual(IEnumerable`1 expectedForeignKey, IEnumerable`1 actualForeignKey, Boolean assertOrder, Boolean compareAnnotations) in /Users/roji/projects/efcore/test/EFCore.Specification.Tests/TestUtilities/ModelAsserter.cs:line 693
It seems that on that line, we're indeed comparing two SortedSets with the Assert.Equal() overload that's not supposed to be used with sets (docs). I'm not sure why this is failing on Npgsql but passing with SQL Server though.
/cc @AndriySvyryd
Indeed, https://github.com/xunit/xunit/issues/2831#issuecomment-1841743496
You are probably using a newer xunit.
Ah yeah, that makes sense, OK. I'll downgrade for now.
Downgraded xunit back to 2.6.1 in https://github.com/npgsql/efcore.pg/pull/3094, the tests indeed now pass.
@AndriySvyryd if you want we can use this to track modifying our tests to react to the new xunit behavior?
Note from triage: do it once we update to use .NET preview 1 in the build.