Skip to content

Commit

Permalink
Fix non-deterministic tests that fail on postgres
Browse files Browse the repository at this point in the history
Fixes #27155
Fixes #27152
  • Loading branch information
maumar committed Jan 25, 2022
1 parent 511b6b8 commit f7b769a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public override Task Average_Grouped_from_LINQ_101(bool async)
ss => from p in ss.Set<ProductForLinq>()
group p by p.Category
into g
select new { Category = g.Key, AveragePrice = g.Average(p => p.UnitPrice) });
select new { Category = g.Key, AveragePrice = g.Average(p => p.UnitPrice) },
elementSorter: e => (e.Category, e.AveragePrice));

public class Ef6GroupByInMemoryFixture : Ef6GroupByFixtureBase
{
Expand Down
3 changes: 2 additions & 1 deletion test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ into g
ss => from p in ss.Set<ProductForLinq>()
group p by p.Category
into g
select new { Category = g.Key, AveragePrice = Math.Round(g.Average(p => p.UnitPrice) - 0.0000005m, 6) });
select new { Category = g.Key, AveragePrice = Math.Round(g.Average(p => p.UnitPrice) - 0.0000005m, 6) },
elementSorter: e => (e.Category, e.AveragePrice));

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ public virtual Task Reverse_in_subquery_via_pushdown(bool async)
.Take(5)
.Distinct()
.Select(e => new { e.EmployeeID, e.City }),
assertOrder: true);
elementSorter: e => e.EmployeeID);

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
Expand Down

0 comments on commit f7b769a

Please sign in to comment.