Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Darling/Darling.Tests/PgFactCollectorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ public void AllSql_CoversEveryQuery_OnePerCollectMethodPlusTheDmvFallback()
{
/* 32 collect methods (31 fact readers plus the #3538 coverage witness), one query each, plus
the DMV-snapshot fallback the blocking-chain method appends through PgBlockingPairRowQuery, plus
PLAN_REGRESSION's #3953 table twin and #5448 daily-totals twin: the plan-regression method runs one of
three reads per server, and Lite has no store for the second or the third (its DuckDB keeps no
latest-snapshot interval table). */
Assert.Equal(LiteCollectMethodSurface.Length + 3, PgFactCollector.AllSql.Count);
PLAN_REGRESSION's #3953 table twin, #5448 daily-totals twin and #5513 mixed twin: the plan-regression
method runs one of four reads per server, and Lite has no store for the second, third or fourth (its
DuckDB keeps no latest-snapshot interval table). */
Assert.Equal(LiteCollectMethodSurface.Length + 4, PgFactCollector.AllSql.Count);
Assert.Contains(PgFactCollector.PlanRegressionMixedSql, PgFactCollector.AllSql);
Assert.Contains(PgFactCollector.PlanRegressionTableSql, PgFactCollector.AllSql);
Assert.Contains(PgFactCollector.PlanRegressionDailySql, PgFactCollector.AllSql);
Assert.Contains(PgBlockingPairRowQuery.DmvSnapshotSql, PgFactCollector.AllSql);
Expand Down Expand Up @@ -254,11 +255,11 @@ It is deliberate in the plan-regression aggregation and nowhere else. */
{
if (sql.Contains("any_value", StringComparison.OrdinalIgnoreCase))
{
/* The three PLAN_REGRESSION reads (#3953: raw, and its interval-table twin; #5448: the daily-totals twin),
/* The four PLAN_REGRESSION reads (#3953: raw, and its interval-table twin; #5448: the daily-totals twin; #5513: the mixed twin),
and nothing else. */
Assert.True(
sql == PgFactCollector.PlanRegressionSql || sql == PgFactCollector.PlanRegressionTableSql
|| sql == PgFactCollector.PlanRegressionDailySql,
|| sql == PgFactCollector.PlanRegressionDailySql || sql == PgFactCollector.PlanRegressionMixedSql,
"any_value() outside the PLAN_REGRESSION reads:\n" + sql);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Darling/Darling.Tests/PlanRegressionDailyBoundaryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void TheFact_RunsBothReadsInOneRepeatableReadReadOnlyTransaction_WithTheL
Assert.Contains("BeginTransactionAsync(System.Data.IsolationLevel.RepeatableRead", fact, StringComparison.Ordinal);
Assert.Contains("SET TRANSACTION READ ONLY", fact, StringComparison.Ordinal);
Assert.Contains("connection, snapshot, context.ServerId, windowFloor", fact, StringComparison.Ordinal);
Assert.Contains("readsDays ? PlanRegressionDailySql : readsTable ? PlanRegressionTableSql : PlanRegressionSql, connection, snapshot)", fact, StringComparison.Ordinal);
Assert.Contains("readsDays ? PlanRegressionDailySql : readsTable ? PlanRegressionTableSql : readsMixed ? PlanRegressionMixedSql : PlanRegressionSql, connection, snapshot)", fact, StringComparison.Ordinal);

var sql = PgFactCollector.PlanRegressionDailySql;
Assert.Contains("l.first_execution_time >= $4::timestamp", sql, StringComparison.Ordinal);
Expand Down
Loading
Loading