forked from mtusi2026/mtusi2026lab2
ЛР 2: закрыть уровень 4
Завершить PostgreSQL, Redis-сессии, миграции, таймауты и диагностику. Зафиксировать собственные тесты и доказательства финального прогона: 43 PASS, 0 FAIL, 0 SKIP; 768 HTTP-запросов без ошибок. Добавить официальный отчёт с запуском, архитектурой, SQL-планами и ограничениями. PR отложен до завершения уровня 5.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestPlanBudgetIncludesFilteredRowsAndLoops(t *testing.T) {
|
||||
plan := map[string]any{"Actual Rows": float64(51), "Actual Loops": float64(1),
|
||||
"Plans": []any{map[string]any{"Actual Rows": float64(51), "Actual Loops": float64(2),
|
||||
"Rows Removed by Filter": float64(8000)}}}
|
||||
if maxVisited(plan) != 16102 {
|
||||
t.Fatal("deep scan hidden by LIMIT or ignored loop count")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPlanBudgetDoesNotDoubleCountParentAndChild(t *testing.T) {
|
||||
plan := map[string]any{"Actual Rows": float64(51), "Actual Loops": float64(1),
|
||||
"Plans": []any{map[string]any{"Actual Rows": float64(51), "Actual Loops": float64(1)}}}
|
||||
if maxVisited(plan) != 51 {
|
||||
t.Fatal("same tuples double-counted through the plan hierarchy")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user