Skip to content

Anchor the Lite CPU-spike scenario to a UTC-day boundary - #4385

Merged
erikdarlingdata merged 1 commit into
devfrom
test/lite-cpu-spike-scenario-clock
Sep 26, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
test/lite-cpu-spike-scenario-clock

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Test-only; no product change and no CHANGELOG entry.

The Lite CPU-spike scenario tests seeded a 24-hour baseline ending at DateTime.UtcNow - 4h. The CPU and I/O-latency baselines are cached by UTC day (#4248), so their query window ends at midnight UTC of the analysis period's start. When the suite ran shortly before 04:00 UTC, that midnight fell almost a full day before the seeded baseline's end. The baseline was then nearly empty, and ANOMALY_CPU_SPIKE never fired.

TestDataSeeder now anchors the scenario period's end to 04:00 UTC of the current day, or of the previous day before 04:00, so the period start lands exactly on a UTC midnight at any time of day.

@erikdarlingdata
erikdarlingdata marked this pull request as ready for review September 26, 2026 04:19
@erikdarlingdata
erikdarlingdata merged commit 6516e28 into dev Sep 26, 2026
15 of 16 checks passed
@erikdarlingdata
erikdarlingdata deleted the test/lite-cpu-spike-scenario-clock branch September 26, 2026 04:19
erikdarlingdata added a commit that referenced this pull request Sep 28, 2026
…s at any hour (#4558)

Lite tests: the FinOps tests' reads cover their seeded rows at any hour.

TestDataSeeder anchors its period end to the most recent UTC midnight plus 4 hours, so the CPU-spike scenario lines up with a UTC day (#4385), and the high-impact seed stamps its rows 30 minutes before that. FinOpsTests read those rows with a fixed 24-hour lookback from now, so between 03:30 and 04:00 UTC the rows fell outside the window and HighImpactSkew_DominantQueryScoresHighest and HighImpactSkew_DominantQueryHighScore failed.

- RunHighImpactAsync now computes its lookback from now back to TestDataSeeder.TestPeriodStart, plus an hour, unless a test passes one explicitly. The seeder's anchor is unchanged.
- HighImpactWindowCoversSeedAtWorstHour checks the window still covers the seed at 03:59 UTC.
- CleanServer_NoDuckDbRecommendations failed the same way: the utilization read uses a fixed 24-hour window with no parameter, so with no CPU samples in it the engine saw 0% CPU and recommended downsizing. SeedCleanFinOpsServerAsync now also seeds the same flat 50% CPU signal over the last three hours; it stays flat, like the original seed, so the reserved-capacity stability rule (which needs a nonzero standard deviation) does not fire. The other FinOps and recommendation scenarios read 7-day windows and are not affected.
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