Add unstableSince timestamp to tolerated tests#9718
Open
mazhelez wants to merge 4 commits into
Open
Conversation
Record when each tolerated test first became unstable via a new 'unstableSince' field on unstable-tests artifact entries. A single Set-UnstableSince pass runs just before the artifact is written and applies one rule per entry: if 'unstableSince' is already set, leave it; otherwise stamp the current UTC time. Because the sliding-window updater fully recomputes the list each run (rebuilding entries from scratch), the previous artifact is consulted so an already-recorded timestamp counts as 'already set' and survives the recompute instead of resetting hourly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234' |
Remove the standalone Set-UnstableSince pass and stamp 'unstableSince' when the entry is built in ConvertTo-UnstableTestEntry. Each driver computes one timestamp per run and passes it through, so every entry created in the same run shares the same value. Timestamps still survive the hourly full recompute: Update-UnstableTestsList now carries each still-unstable test's prior 'unstableSince' forward from the previous artifact, so a rebuilt entry keeps its original time instead of being restamped. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Previously a newly unstable test left Update-UnstableTestsList with an empty 'unstableSince' that ConvertTo-UnstableTestEntry stamped later. That intermediate empty value was confusing and split the stamping across two functions. Now Update-UnstableTestsList assigns the run timestamp directly for a test with no prior entry (and still carries a prior timestamp forward), so its output is already correct. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Treats 'unstableSince' as a designed-in field rather than a bolted-on one: removes a stale doc comment that claimed new tests are left without a timestamp, drops the redundant -UnstableSince argument from the entry factory calls that follow Update-UnstableTestsList (those entries already carry their timestamp), and rewrites the surrounding comments and DESIGN notes in plain, native terms. Behavior is unchanged; all 61 tests pass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.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.
What & why
Tolerated ("unstable") tests are tracked in the per-branch
unstable-tests.jsonartifact, but until now there was no record of when a test first became unstable. This adds anunstableSincefield to each entry so we can see how long a test has been continuously flaky (useful for triage and for eventually retiring or fixing long-standing offenders).The rule is deliberately simple and lives in a single place. A new
Set-UnstableSincepass runs just before the artifact is written and, for each entry, applies one rule: ifunstableSinceis already set, leave it; otherwise stamp the current UTC time (ISO 8601).The one non-obvious bit: the hourly updater fully recomputes the list from scratch each run, so rebuilt entries start with no timestamp. To keep the timestamp meaningful (instead of resetting to "now" every hour),
Set-UnstableSincealso consults the previous artifact, so a test that already had a timestamp there is treated as "already set" and keeps it. A test that self-heals off the list and later returns starts a fresh timestamp.Linked work
Fixes #
How I validated this
What I tested and the outcome
build/scripts/TestTolerancelocally: 61 passed, 0 failed.Set-UnstableSince: stamps a fresh UTC timestamp when missing, keeps an already-set value, preserves a timestamp carried over from the previous artifact across a full recompute, and adds the property when an entry lacks it entirely.Risk & compatibility
Low risk; scoped to the test-tolerance updater scripts and their tests.
unstableSince; the first run after this change stamps every surviving test with that run's time, and the value is preserved on subsequent runs.Add-FailedTestsToUnstableTests) no longer stamps timestamps itself; stamping is centralized inSet-UnstableSince, which the driver scripts call once before saving.