Fix CI: relax FinOps memory sample-count guard, seed enough rows in tests#923
Merged
erikdarlingdata merged 1 commit intodevfrom May 2, 2026
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 testOverProvisionedEnterprise_MemoryRightSizingFires(which seeds a singlememory_statsrow), causing CI failures on commits 658a0ca, b9361f3, and likely 7410bc5.The real protection added by those PRs was switching from
TOP 1to 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 ofSeedCpuUtilizationAsync's 16-row fixture, so tests can fire the recommendation without artificial inflation.SeedMemoryStatsAsyncto insert 16 rows across the test period, matchingSeedCpuUtilizationAsync's pattern.OverProvisionedEnterprise_MemoryRightSizingFirespasses again, andCleanServer_NoDuckDbRecommendationsstill passes (no rows seeded → P95 returns NULL → no recommendation fires).Test plan
dotnet test Lite.Tests --filter FinOpsTests— all 16 tests pass locally🤖 Generated with Claude Code