Skip to content

Add retestClosedIssues pipeline to propose unexclusions for fixed tests - #7790

Draft
adamfarley wants to merge 139 commits into
adoptium:masterfrom
adamfarley:grinder_runner_for_unexclusions
Draft

adamfarley wants to merge 139 commits into
adoptium:masterfrom
adamfarley:grinder_runner_for_unexclusions

Conversation

@adamfarley

@adamfarley adamfarley commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a Jenkins pipeline, buildenv/jenkins/retestClosedIssues.groovy, that:

  1. Finds tests excluded in the OpenJDK ProblemLists whose tracked issue is now closed.
  2. Reruns them in Grinder on the JDK versions and platforms they were excluded for.
  3. If a test passes everywhere its exclusion applies, removes the exclusion.
  4. Pushes the change to a branch (auto-unexclude-<build>) on the repository the job was checked out from, and prints a compare URL. If it can't push, it archives a git-compatible patch.

A human opens and reviews the PR. The pipeline never changes master and does not call the GitHub REST API.

The pipeline works only in the job's SCM checkout. It does not clone adoptium/aqa-tests or any other repository. The scripts it runs and the ProblemLists it reads and edits are the ones on the branch the job runs from.

The script defines no schedule, so we will run it by hand and add a schedule in the Jenkins job.

What's in this PR

  • retestClosedIssues.groovy: the pipeline (parse, launch Grinder, summarise, push).
  • exclude_parser.py: each entry now carries EXCLUDE_FILE, the ProblemList it came from.
  • issue_status.py: rewritten to use only the standard library, so agents need no pip. It retries, honours rate-limit headers and can stop early.
  • remove_exclusions.py: edits the ProblemLists for the passing tests.
  • Tests and CI: .github/workflows/test-grinder-maker.yml runs five test modules.
  • Docs: scripts/disabled_tests/README.md and INTEGRATION.md, which covers setup, credentials, parameters and a smoke-run checklist.

Behaviour worth reviewing

  • SCM checkout only. Because nothing is cloned, a change to any script in scripts/disabled_tests/ takes effect as soon as the job runs from the branch that holds it. The ProblemLists retested are the ones on that branch, so to retest upstream's lists, run the job from a branch that matches upstream.
  • Where the branch is pushed. The repository is worked out from the checkout's origin, which must be on github.com (https and ssh forms are handled, and any credentials in the URL are dropped). The compare URL's base branch is CHANGE_TARGET, then BRANCH_NAME, then GIT_BRANCH, then master. If origin is not a GitHub repository, nothing is pushed: the patch is archived and the build is UNSTABLE.
  • Random selection. --max-fixed (in issue_status.py) and MAX_GRINDERS (in the pipeline) choose candidates at random, so repeated runs don't keep retrying the same tests. Runs are deliberately not reproducible.
  • A test's platforms stay together. Under MAX_GRINDERS, whole (JDK, test) groups are selected. A broad exclusion such as linux-all is only removed if every platform it covers passed.
  • linux-all means s390x, ppc64le, x86-64 and aarch64. arm and riscv64 are not required.
  • Each ProblemList is judged on its own results. The main, alpine/ and vendors/* directories can all exclude the same test. Grouping by exclude file means a pass in one file never edits another.
  • Rate limiting is not fatal. A URL whose retries run out (at most 120s waiting per URL) is skipped and listed in the log. Other tracker errors still fail the stage.
  • Grinder ABORTED is separate from FAIL. It is reported on its own and never unexcludes a test.
  • Only hotspot exclusions are retested or edited, whatever JDK_IMPL is. Solaris and z/OS platform tokens are not removed.
  • Tokens are kept off command lines and URLs, where other users on an agent could read them with ps. issue_status.py gets its credentials from AQA_ISSUE_TRACKER_GITHUB_USER and AQA_ISSUE_TRACKER_GITHUB_TOKEN. The push uses a temporary GIT_ASKPASS helper that holds no secret and is deleted afterwards, even if the push fails. See INTEGRATION.md.

Testing

214 tests across test_remove_exclusions, test_issue_status, test_exclude_parser, test_issue_filter and test_pipeline, all passing.

test_pipeline runs the real retestClosedIssues.groovy under a stubbed Jenkins (tests/pipeline_harness.groovy). Shell steps run for real in a temporary git repo standing in for the SCM checkout, so the parser, issue_status.py, the Groovy logic, remove_exclusions.py and git are exercised together. Only the network is faked: tracker responses, curl probes and Grinder results. git push is recorded, never run. The tests check that nothing is cloned, fetched or reset, and that the push and compare URLs follow origin. They need groovy, jq, git and python3, and skip without them. CI installs them.

The suite caught a real bug while it was written: remove_exclusions.py mixed results across ProblemList files that excluded the same test. That is fixed and covered by tests.

Not yet done: a run on a real Jenkins. The Jenkins steps (withCredentials, writeFile, build) were only tested through stubs. Please do the smoke run in INTEGRATION.md section 7 (MAX_FIXED=3, one JDK version) before relying on it.

Known limitations / follow-ups

  • The push token (the GITHUB_TOKEN credential) needs write access to the repository the job's SCM checkout came from, which is often a fork.
  • The archived patch is made from the SCM checkout. It may not apply cleanly to another repository, such as upstream head, if the exclude files differ.
  • Jenkins jobs that still point at triggerGrinder.groovy need re-pointing. triggerGrinder may be removed in a future PR.
  • Collections.shuffle in selectJobGroups may be blocked by the Jenkins script sandbox. If it is, it needs approving or replacing.
  • Plain HTTP 403 responses are still retried like rate limits. This is intentional to aid throughput, as the delay won't solve anything if the 403 response is tied to a permanent issue, and not rate limiting.
  • test_exclude_openjdk.py (3 tests) and test_playlist_parser.py (1 test) already fail independently of this PR. CI doesn't run them.

Resolves #7204

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Any comment that starts with a hash is treated as a non-url,
and we don't try to test it as a URL.

Also adding explicit URLs to remove ambiguity, and to allow
projects with access to those URLs to run the same checks as
Adoptium.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
...and recommend next steps to the user, without affecting the
pass/fail of the script.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
...so the user can determine which exclude files need to be
updated to unexclude a potentially newly-passing test.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Also includes:
- Filtering out duplicate jdk versions identified via commit PRs
- Removing jdk versions above the lowest "and above"
- Sorting jdk versions list

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Git does not permit these to run.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
The full issue_status.py script now takes 15 minutes to run.

This is unacceptable for a PR check, so I've added a pr-check-specific
minimal mode that only validates the url.

This change also adds the use of issue_status.py in minimal mode
to the disabledTestsLinter git workflow.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
Plus tests for same.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
@karianna
karianna marked this pull request as draft November 2, 2026 09:40
grinder_runner_for_unexclusions

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
When an issue associated with an excluded test is closed, then
this code reruns the test on the relevant platform and see if it is
ready to be unexcluded.

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
A high --max-fixed made issue_status.py query every URL, hit
GitHub rate limits and sleep in backoff for up to ~2h per URL
with no output.

- Log progress at INFO by default; -v enables DEBUG
- Honour Retry-After/X-RateLimit-Reset when retrying
- Cap total retry wait per URL at 120s
- Skip URLs when retries are exhausted: warn, omit from the
  output and list them at the end. Exit code is unaffected.
- Stop promptly once --max-fixed is reached
- Record Grinder ABORTED separately from FAIL in the retest
  summary; aborted tests are still never unexcluded.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
This prevents us from running the same tests two weeks in a row, if
somehow end up with a selection of tests that always fail (blocking
other tests from having a chance to run).

Signed-off-by: Adam Farley <adfarley@ibm.com>
Retest candidates are now picked at random and kept grouped
by test, so a broad exclusion such as linux-all is only
removed when every platform it covers has passed.

Pipeline and scripts:
- Select jobs under MAX_GRINDERS by whole (JDK, test) group
  and log the selected, skipped and oversized groups.
- Record Grinder ABORTED separately from FAIL and report
  per-JDK aborted counts in the summary.
- issue_status.py: honour Retry-After and rate-limit reset,
  cap the wait per URL, and skip URLs whose retries run out
  without failing the build. Shuffle URLs for --max-fixed.
- exclude_parser.py: emit EXCLUDE_FILE for each entry.
- remove_exclusions.py: judge each ProblemList file on its
  own results. Previously the main, alpine and vendor files
  for one test were merged and only one was edited. linux-all
  no longer requires arm or riscv64.
- Remove generate_grinders.py, now unused.

Tests and CI:
- Add test_pipeline.py, which runs the real Groovy pipeline
  under a stubbed Jenkins (pipeline_harness.groovy,
  pipeline_support.py, fake_http), replacing the Python
  mirrors of the Groovy logic in test_remove_exclusions.py.
- Add tests for retries, skipped URLs, EXCLUDE_FILE and
  per-file grouping.
- Run all five test modules in CI, with groovy and jq, and
  widen the path filters.

Docs: update README.md and INTEGRATION.md to match.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
Tokens passed as arguments or embedded in a URL can be read by
other users on the agent with ps.

- Stage 1: give issue_status.py its user and token through
  AQA_ISSUE_TRACKER_GITHUB_USER and _TOKEN instead of
  --github-user and --github-token. The flags remain for local
  use, with a help-text warning.
- Stage 4: push to a URL with no password and supply the token
  through a temporary GIT_ASKPASS helper, which holds no secret
  and is removed afterwards, even if the push fails.
- Tests assert the token is in neither the push command nor the
  URL, that issue_status.py still receives it, and that the
  helper is cleaned up. Docs updated.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
@adamfarley adamfarley changed the title WIP: Automatic Test Unexclusion Candidate Tooling Add retestClosedIssues pipeline to propose unexclusions for fixed tests Dec 3, 2026
- Delete the unused _http_get() and _fetch() helpers.
- Drop the unreachable "status in _RETRY_STATUS_LIST" check
  after urlopen(): urllib raises HTTPError for 4xx and 5xx
  responses, so retries already happen in the except branch.
  Fix the docstring to match.
- Remove the unused ISSUE_TRACKER_RESOLUTION and
  ISSUE_TRACKER_ACTION fields from SchemeWithStatus.

No functional change.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
Keep the old pipeline in place for now; its removal will be
discussed with the owner and handled in a separate change.
INTEGRATION.md now says retestClosedIssues.groovy supersedes
it and that it cannot run as it stands.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
The pipeline made a second clone of upstream adoptium/aqa-tests
and ran there, so exclude_parser.py and common/ came from
upstream and changes to them did not take effect until merge.

Do everything in the SCM checkout instead. Remove the clone,
fetch and reset steps and the script copying. Push the
auto-unexclude branch to the repository the checkout came from,
working the owner/repo out from its origin remote (https, ssh
and credential-bearing URLs). Use the job's branch as the compare
URL base, falling back to master. If origin is not a GitHub
repository, archive the patch and mark the build UNSTABLE.

The archived patch is made from the SCM checkout and may not
apply to another repository whose exclude files differ.

Make the test workspace a single git repo with a fake origin and
add tests for the new behaviour.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
Collections.shuffle may need script-sandbox approval on Jenkins.
Use a hand-written Fisher-Yates shuffle driven by a Park-Miller
generator, which needs only arithmetic and list indexing.

Seed it with the build number, so each build selects differently
and the same build number gives the same selection. Add tests for
the shuffle and for the seeded selection, and a guard test that
the pipeline calls no shuffle or Random library methods.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
Three test_exclude_openjdk tests and test_playlist_parser failed
independently of the grinder-maker work, and CI did not run
either module.

- exclude_openjdk.py: add _safe_print() and use it for output
  containing non-ASCII characters (emoji, arrow). On consoles
  whose encoding cannot represent them (e.g. Windows cp1252) it
  substitutes replacement characters instead of raising
  UnicodeEncodeError.
- test_exclude_openjdk.py: normalise path separators before
  asserting on 'vendors/eclipse' so the test passes on Windows.
- test_playlist_parser.py: playlist_parser.py now exits with
  status 1 on a malformed disable node (0e98170) instead of
  skipping it, so the existing test, whose input contained a
  misspelled variation, could no longer pass. Remove that node
  from playlist_input.xml, and add
  test_unknown_variation_exits_with_error, using the new
  playlist_input_invalid_variation.xml, to check that the parser
  logs the error with file and line and raises SystemExit(1).
- test-grinder-maker.yml: install requirements.txt (lxml is
  needed by playlist_parser) and run test_exclude_openjdk and
  test_playlist_parser.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
grinder_runner_for_unexclusions

Signed-off-by: Adam Farley <adfarley@ibm.com>
JDK-8297274 is closed as Duplicate, but was reported as
'Unknown resolution: "Duplicate". Action: investigate.' instead
of taking the status of the issue it duplicates.

The JBS 'Duplicate' link type is labelled "duplicates" in both
directions, and for JDK-8297274 the original (JDK-8299424) is an
outwardIssue. _find_duplicate_target_key() only read inwardIssue,
so it found no target and the chain was never followed.

- _find_duplicate_target_key() now checks outwardIssue, then
  inwardIssue, on links of type Duplicate. It skips issues
  already in the chain being followed, so circular chains and
  links back to the issue we came from are not followed.
- Links are still only followed while the current issue's
  resolution is Duplicate.
- Add tests: an outward link with an unrelated inward Relates
  link (the JDK-8297274 structure), a chain mixing both
  directions, a link back into the chain, and an issue that is
  not itself a duplicate.
- Remove the UTF-8 BOM from the start of test_issue_status.py.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
Hotspot tests were reported as 'Could not locate test file' and
not retested. For JDK 9+, resolveTarget() probed
test/hotspot/<path>, but hotspot's jtreg tests live under
test/hotspot/jtreg/ (test/hotspot also holds gtest). e.g.
compiler/whitebox/ForceNMethodSweepTest.java is at
test/hotspot/jtreg/compiler/whitebox/ in jdk25u, so the probe
returned 404.

- retestClosedIssues.groovy: probe test/hotspot/jtreg/<path>.
  test/jdk and test/langtools have no jtreg level and are
  unchanged.
- test_pipeline.py: update the expected probe URLs.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
Grinders launched by retestClosedIssues.groovy ran on whichever
machines Grinder picked by default, so some used the wrong
labels for their platform.

- Stage 1 reads buildenv/jenkins/config/temurin/default.json
  from the checkout and fails the run, before any issue tracker
  calls, if the file is missing, is not valid JSON, or is not a
  non-empty array of objects.
- Stage 2 sets LABEL_ADDITION from
  PLATFORM_ADDITIONAL_TEST_LABELS and CLOUD_PROVIDER from
  PLATFORM_ADDITIONAL_TEST_PARAMS, only when the Grinder's
  platform (e.g. ppc64_aix, x86-64_linux) has an entry. LABEL is
  not set.
- Tests: add an error() stub to the pipeline harness and a
  fixture default.json for each test workspace. Cover a label
  only, a cloud provider only, an unlisted platform, a missing
  file, invalid JSON, a wrong top-level type, and the real
  default.json.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
Before launching Grinders, retestClosedIssues now downloads the
Adoptium supported-platforms data once, in Stage 1, and checks it
for every test and platform in Stage 2. The run fails if the data
cannot be downloaded or understood.

If the JDK version is not supported on the platform, that test
and platform is not run, and is listed in the PR description
with the reason. A platform counts as supporting a version if
any distro in its Adoptium category does. A JDK version missing
from the data uses the highest version listed for that category.
Platforms with no category (e.g. solaris, z/OS, x86-32 windows)
are skipped too, as support cannot be confirmed.

Entries from the openjdk/excludes/alpine files now run on the
Alpine Grinder platforms (x86-64_alpine-linux and
aarch64_alpine-linux) and are checked against the Alpine Linux
categories. Other platforms named in those files are skipped.
remove_exclusions.py maps the Alpine platforms to linux-x64 and
linux-aarch64, and a linux-all line in an alpine file is removed
once Alpine x64 (and, from JDK 21, Alpine aarch64) pass.

The skipped-tests heading no longer says "not found in upstream
OpenJDK repos", as the section now covers several reasons.

Assisted by IBM Bob

Signed-off-by: Adam Farley <adfarley@ibm.com>
Signed-off-by: Adam Farley <adfarley@ibm.com>
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.

Grinder generator for excluded tests

1 participant