Skip to content

Fix CI: relax FinOps memory sample-count guard, seed enough rows in tests#923

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/finops-memory-rec-test-threshold
May 2, 2026
Merged

Fix CI: relax FinOps memory sample-count guard, seed enough rows in tests#923
erikdarlingdata merged 1 commit intodevfrom
fix/finops-memory-rec-test-threshold

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

PRs #918 (Dashboard) and #920 (Lite) added a sample-count guard (>= 500) to the new 7-day P95 memory recommendation logic. 500 was overly conservative and broke the Lite FinOps test OverProvisionedEnterprise_MemoryRightSizingFires (which seeds a single memory_stats row), causing CI failures on commits 658a0ca, b9361f3, and likely 7410bc5.

The real protection added by those PRs was switching from TOP 1 to P95; the sample minimum is just a sanity check against degenerate single-point inputs. ~16 samples is enough to compute a meaningful P95 and matches the shape of SeedCpuUtilizationAsync's 16-row fixture, so tests can fire the recommendation without artificial inflation.

Test plan

  • dotnet test Lite.Tests --filter FinOpsTests — all 16 tests pass locally
  • CI is green on dev after merge

🤖 Generated with Claude Code

…ests

PRs #918 and #920 added a sample-count guard (>= 500) to the new 7-day P95
memory recommendation logic. 500 was overly conservative and broke the
Lite FinOps test OverProvisionedEnterprise_MemoryRightSizingFires, which
seeds a single memory_stats row.

The real protection added by those PRs was switching from TOP 1 to P95;
the sample minimum is just a sanity check against degenerate single-point
inputs. ~16 samples is enough to compute a meaningful P95 and matches the
shape of SeedCpuUtilizationAsync's 16-row fixture, so tests can fire the
recommendation without artificial inflation.

- Lower threshold from 500 to 16 in both Dashboard and Lite (checks #3
  and #12) so the value reflects the actual ask: "more than one reading"
  rather than "8+ hours of data."
- Update Lite's SeedMemoryStatsAsync to insert 16 rows across the test
  period (matching SeedCpuUtilizationAsync's pattern). This makes
  OverProvisionedEnterprise_MemoryRightSizingFires pass again and keeps
  CleanServer_NoDuckDbRecommendations green (still no rows seeded for
  the clean scenario → P95 returns NULL → no recommendation).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 76d825f into dev May 2, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/finops-memory-rec-test-threshold branch May 2, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant