Skip to content

Make flaky detector verify recurrence postdates the fix before commenting - #13930

Merged
ViktorHofer merged 2 commits into
mainfrom
flaky-detector-recurrence-timing
Jun 3, 2026
Merged

Make flaky detector verify recurrence postdates the fix before commenting#13930
ViktorHofer merged 2 commits into
mainfrom
flaky-detector-recurrence-timing

Conversation

@ViktorHofer

Copy link
Copy Markdown
Member

Makes the flaky-test detector's closed-issue handling timing-aware so it stops mislabeling stale, pre-fix failures as recurrences.

Problem

When the detector finds a flaky test that maps to a recently-closed tracking issue, it commented "recurred" on that issue without checking when the failures occurred. Because the look-back window (-DaysBack) routinely spans the date a fix merged, failures from before the fix were treated as evidence of recurrence. For example, issue #13734 was fixed via a merged PR the day before, yet the detector commented that it had recurred based on pre-fix builds.

Change

  • .github/workflows/flaky-test-detector.agent.md (Step 4): before posting a recurrence comment on a closed issue, the agent must now confirm that at least one failure's build start time is strictly after the fixing PR merged (using the closing PR's merge-commit time and actual build start times, not the date-only lastSeen). If every failure predates the fix/close, the evidence is treated as stale: no comment, no reopen, skip the test for the run.
  • .github/skills/flaky-test-detector/SKILL.md: companion note in the "Interpreting Results" section documenting the same rule.

Body/prose-only edits to the agent workflow and skill — no lock recompile required.

…ting

The detector's closed-issue handling commented 'recurred' on any related
issue closed within ~30 days, without checking whether the failures
actually occurred after the fix merged. Because the look-back window
(-DaysBack) routinely spans the fix date, stale pre-fix failures were
mislabeled as recurrences (e.g. issue #13734, fixed the day before).

Step 4 now requires confirming at least one failure's build start time is
strictly after the fixing PR merged (using the closing PR's merge commit
time, and build start times rather than the date-only lastSeen) before
posting a recurrence comment; otherwise the evidence is treated as stale
and the test is skipped for the run. SKILL.md gains a matching note.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 3, 2026 08:48
@ViktorHofer
ViktorHofer requested a review from a team as a code owner June 3, 2026 08:48
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Skill Validator Results

⚠️ Warnings or advisories found

Scope Checked
Skills 1
Agents 0
Total 1
Severity Count
--- ---:
❌ Errors 0
⚠️ Warnings 1
ℹ️ Advisories 0

Summary

Level Finding
ℹ️ Found 1 skill(s)
ℹ️ [flaky-test-detector] 📊 flaky-test-detector: 3,581 BPE tokens [chars/4: 3,475] (standard ~), 13 sections, 5 code blocks
ℹ️ [flaky-test-detector] ⚠ Skill is 3,581 BPE tokens (chars/4 estimate: 3,475) — approaching "comprehensive" range where gains diminish.
ℹ️ ✅ All checks passed (1 skill(s))
Full validator output ```text Found 1 skill(s) [flaky-test-detector] 📊 flaky-test-detector: 3,581 BPE tokens [chars/4: 3,475] (standard ~), 13 sections, 5 code blocks [flaky-test-detector] ⚠ Skill is 3,581 BPE tokens (chars/4 estimate: 3,475) — approaching "comprehensive" range where gains diminish. ✅ All checks passed (1 skill(s)) ```

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the flaky-test detector’s guidance for handling recently-closed tracking issues so it only comments “recurred” when there is evidence of failures occurring after the fix PR merged, avoiding stale pre-fix failures being misclassified as recurrences.

Changes:

  • Adds a timing-aware recurrence check for closed issues: require at least one post-fix failure (by build start time) before commenting.
  • Documents the same rule in the flaky-test-detector skill’s “Interpreting Results” guidance.
Show a summary per file
File Description
.github/workflows/flaky-test-detector.agent.md Adds post-fix timestamp verification steps before commenting on recently-closed issues.
.github/skills/flaky-test-detector/SKILL.md Documents the post-fix recurrence rule in the skill guidance.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment thread .github/workflows/flaky-test-detector.agent.md Outdated
gh issue view --json does not support a timelineItems field. Use the
supported closedByPullRequestsReferences field to get the closing PR, then
gh pr view --json mergedAt for its merge time.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ViktorHofer
ViktorHofer merged commit 7075053 into main Jun 3, 2026
11 checks passed
@ViktorHofer
ViktorHofer deleted the flaky-detector-recurrence-timing branch June 3, 2026 09:51
@JanProvaznik

Copy link
Copy Markdown
Member

@ViktorHofer pls squash next time

This was referenced Aug 11, 2026
This was referenced Aug 19, 2026
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.

4 participants