fix: exclude PR-modified tests from the flaky count - #1171
Open
zeexzeex wants to merge 1 commit into
Open
Conversation
A failure in a test that the pull request itself modified is likely caused by that change, so counting it as an independent flaky occurrence overstates the number of affected pull requests. Compare the failing test against the files the pull request touched and drop the occurrence when they match. When the file list cannot be fetched the occurrence is kept, so incomplete information never removes a genuine failure. Fixes: nodejs#1164 Signed-off-by: Avocado <ujubongbong@gmail.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
A failure in a test that the pull request itself modified is counted as an independent flaky occurrence, which overstates the number of affected pull requests.
Taking the example from the issue,
ffi/test-ffi-fast-bufferis listed with two failed PRs in the 2026-08-15 report:src/ffi/fast.cc,test/ffi/test-ffi-fast-buffer.jslib/fs.js, unrelated fs testsOnly #65113 is a genuine occurrence.
How
Compare the failing test against the files the pull request touched, and drop the occurrence when they match.
formatAsMarkdownalready skips entries with fewer than two PRs, so such an entry leaves the report on its own.When the file list cannot be fetched the occurrence is kept, following
lib/benchmark.js: incomplete information should never remove a genuine failure.This makes
aggregate()async. Both call sites inbin/ncu-ci.jswere already async methods. The lazy fallbacks insideformatAsMarkdown()anddisplay()now throw instead, since a pending promise there would fail silently.Tests
Four tests cover the exclusion, the untouched case, the fetch failure, and non-test failures. Removing the exclusion makes only the first fail, while the other three keep passing.
Fixes: #1164