GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Replace static TestSuiteOrdering registry with dynamic class orderer by gnodet · Pull Request #13169 · apache/maven

Conversation

@gnodet

@gnodet gnodet commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Problem

The TestSuiteOrdering class on maven-4.0.x uses a static Map<Class<?>, Integer> registry. Every IT class must be explicitly added to this map — if it is missing, the framework prints a warning and the test is not run at all:

Test class org.apache.maven.it.MavenITgh12522NonExtensionPluginTest is not present in TestSuiteOrdering
 - please add it or annotate with @Tag("disabled")

This caused all recently backported ITs (33+ classes) to be silently excluded from CI on this branch.

Fix

Replace the static registry with the dynamic ClassOrderer already used on master: tests are ordered automatically by their numeric suffix (gh-XXXXX > mng-XXXXX > it-XXXXX in descending numeric order), with no explicit registration required. New IT classes on this branch will be picked up automatically going forward.

The only adaptation from master:

  • Keep the String-based Verifier constructor (maven-4.0.x does not have the Path-based one)
  • Keep the ExecutorHelper mode logging already present on this branch

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet
Replace static TestSuiteOrdering registry with dynamic class orderer
96bf089
The static map-based TestSuiteOrdering on maven-4.0.x required every new
IT class to be explicitly registered. Any class missing from the registry
was silently skipped (not run), which caused all recently backported ITs
to be excluded from CI runs on this branch.

Replace with the dynamic ClassOrderer already used on master: tests are
ordered automatically by their numeric suffix (gh-XXXXX > mng-XXXXX >
it-XXXXX in descending order), with no explicit registration needed.

The only adaptation from master is keeping the String-based Verifier
constructor (maven-4.0.x does not have the Path-based one) and keeping
the ExecutorHelper mode logging already present on this branch.
@gnodet gnodet added this to the 4.0.0-rc-7 milestone Sep 17, 2026
@gnodet gnodet added the enhancement New feature or request label Sep 17, 2026
gnodet-bot
gnodet-bot suggested changes Sep 17, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The dynamic ordering approach is a clear improvement over a 750-line hand-maintained list, but there are two correctness issues that must be fixed before merge.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gnodet
Address review: fix MavenITBootstrapTest ordering and log unrecognize…
2cad5a4
…d classes

- MavenITBootstrapTest now gets key '9-...' so it sorts first after
  descending reversal, matching the original priority -10 behavior
- Unrecognized class name patterns log a warning via the existing 'out'
  field (previously declared but unused in the new implementation)
- Update class javadoc to document both behaviors
@cstamas

cstamas commented Sep 17, 2026

Copy link
Copy Markdown
Member

@gnodet now we have https://gist.github.com/cstamas/3fc3740aece466e35a1741c9ea2b6bad

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gnodet-bot
gnodet-bot reviewed Sep 17, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-review after commit 2cad5a49.

Prior findings — status:

  • ✅ Bootstrap ordering bug (finding #1): Fixed. MavenITBootstrapTest now returns key "9-MavenITBootstrapTest", which correctly sorts to position 0 after the descending reversal. Semantics match the original priority -10.
  • ✅ Dead out field / no warning (finding #2): Fixed. The fallback branch now calls out.println(...), giving the field a live use and surfacing unrecognized classes at test-run time.

New finding:

One correctness issue remains with the "4-" prefix assigned to unrecognized class names.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gnodet
fix: move Bootstrap check first and use '0-' prefix for unknowns
b16207b
Unknown classes were assigned '4-' prefix which, after .reversed(),
sorted them BETWEEN Bootstrap ('9-') and gh-tests ('3-'), contradicting
the Javadoc claiming they run last.

Two fixes:
1. Use '0-' for unrecognized classes so they sort last (after all known
   categories) in the descending order.
2. Move the MavenITBootstrapTest special-case to the top of getOrderKey
   (before the three pattern checks) so a hypothetical future rename like
   MavenITBootstrap42Test doesn't accidentally match IT_PATTERN and sort last.

Update Javadoc to accurately document the actual execution order.

Actual order is now: Bootstrap (9-) → gh (3-) → mng (2-) → it (1-) → unknowns (0-)
gnodet-bot
gnodet-bot approved these changes Sep 17, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-review after commit b16207b.

Prior findings — status:

  • ✅ Bootstrap ordering bug (finding #1, commit 2cad5a49): Fixed — MavenITBootstrapTest gets key "9-MavenITBootstrapTest", sorts first.
  • ✅ Dead out field / no warning (finding #2, commit 2cad5a49): Fixed — fallback path logs unrecognized class names.
  • ✅ Unknown classes sort before gh-tests with "4-" prefix (finding #3): Fixed — now uses "0-" prefix, so unknowns sort last after all known categories.
  • ✅ Bootstrap fragility: Fixed — Bootstrap special-case moved before pattern matching, guarding against future renames like MavenITBootstrap42Test accidentally matching IT_PATTERN.

Javadoc accurately reflects the actual execution order: Bootstrap → gh → mng → it → unknowns.

All three requested changes are addressed. Code is correct.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet
Add mdep pattern and deduplicate fallback warnings in TestSuiteOrdering
5a18354
- Add MDEP_PATTERN to handle MavenITmdep<N>Test class names (e.g.
  MavenITmdep0590ClassifiedPomArtifactFromReactorTest), ordering them
  in the same bucket as it-prefixed tests
- Deduplicate the fallback warning using a ConcurrentHashMap-backed Set,
  so each unrecognized class name is only logged once instead of once
  per surefire thread invocation (which caused the same message to appear
  20+ times in the output)
- Clarify Javadoc to mention the mdep prefix
@gnodet gnodet mentioned this pull request Sep 17, 2026
Add mdep pattern and deduplicate fallback warnings in TestSuiteOrdering #13171
Merged
@gnodet gnodet added maintenance and removed enhancement New feature or request labels Sep 17, 2026
gnodet-bot
gnodet-bot reviewed Sep 18, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-review after commit 5a18354 (adds MDEP_PATTERN + WARNED_CLASSES dedup to the 4.0.x backport).

Prior findings (from approved SHA b16207b) — still addressed: ✅ Bootstrap ordering, ✅ dead out field, ✅ "0-" prefix for unknowns.

New findings (introduced by 5a18354):


Finding #1 — Javadoc not updated for mdep (nit, must fix)

The class-level Javadoc still describes three categories and omits mdep:

The master version of this commit (PR #13171) correctly says:

Apply the same update here.


Finding #2 — out field not final (nit, must fix)

The new commit leaves out mutable:

Master already makes it :

The field is only written once (at class-load time) and never reassigned — there is no reason to leave it non-final. This was the state before the backport commit was ported from master.

Fix: add .


Both are nits copied verbatim from what master (PR #13171) already has. Two-character + Javadoc fixes.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gnodet-bot
gnodet-bot reviewed Sep 18, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-review after commit 5a18354 (adds MDEP_PATTERN + WARNED_CLASSES dedup to the 4.0.x backport).

Prior findings (from approved SHA b16207b) — still addressed: ✅ Bootstrap ordering, ✅ dead out field, ✅ "0-" prefix for unknowns.

New findings (introduced by 5a18354):


Finding #1 — Javadoc not updated for mdep (nit, must fix)

The class-level Javadoc still describes three categories and omits mdep:

 * Test suite ordering that orders tests by prefix (gh-xxx, mng-xxx, it-xxx) in descending order.
 ...
 *   <li>it-prefixed tests (descending number)</li>
 *   <li>Unrecognized class name patterns — fall back to alphabetical ordering (logged as warning)</li>

The master version of this same commit (PR #13171) correctly says:

 * Test suite ordering that orders tests by prefix (gh-xxx, mng-xxx, it-xxx, mdep-xxx) in descending order.
 ...
 *   <li>it-prefixed and mdep-prefixed tests (descending number)</li>
 *   <li>Unrecognized class name patterns — fall back to alphabetical ordering (logged once as warning)</li>

Apply the same update here — the mdep category was added to the implementation but the Javadoc wasn't synced.


Finding #2 — out field not final (nit, must fix)

The new commit leaves out mutable:

private static PrintStream out = System.out;

Master already makes it final:

private static final PrintStream out = System.out;

The field is only written at class-load time and never reassigned — no reason to omit final. This inconsistency was introduced when the commit was cherry-picked from master to 4.0.x.

Fix: add final.


Both are two-character fixes that bring the 4.0.x file in sync with what master (PR #13171) already has.

This review was generated by an AI agent, Hermes on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet
Address review: add final to out field, sync Javadoc with mdep category
ac8871a
@gnodet

gnodet commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in ac8871a:

  • Finding [MNG-5445] Fix missing requirement in AbstractStringBasedModelInterpolator #1 (Javadoc not updated for mdep): Updated class-level Javadoc — added mdep-xxx to the prefix list in the first line, updated list item to say "it-prefixed and mdep-prefixed tests", and updated the unknown-classes note to say "logged once as warning".
  • Finding Use Eclipse/Sisu 0.0.0.M2 milestone #2 (out field not final): Added final to private static final PrintStream out = System.out;.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gnodet-bot
gnodet-bot approved these changes Sep 18, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-review after commit ac8871abc.

Prior findings — status:

  • ✅ Javadoc not updated for mdep (finding #1, from 5a18354 review): Fixed — class-level Javadoc now reads "gh-xxx, mng-xxx, it-xxx, mdep-xxx" and the <li> correctly says "it-prefixed and mdep-prefixed tests". In sync with master (PR #13171).
  • ✅ out field not final (finding #2, from 5a18354 review): Fixed — field is now private static final PrintStream out = System.out;.

All previous findings addressed. Code is correct and matches the master version. Ready to merge.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cstamas
cstamas approved these changes Sep 18, 2026
View reviewed changes
@gnodet
Rename unnumbered ITs to include GH issue/PR number
5d95616
- MavenITBomConsumerPomPropertyResolutionTest → MavenITgh12625...
- MavenITConsumerPomBomFromSettingsRepoTest → MavenITgh11767...
- MavenITMvnupToolchainPluginStrategyTest → MavenITgh12922...
gnodet-bot
gnodet-bot suggested changes Sep 18, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-review after commit 5d95616 (rename unnumbered ITs to include GH issue/PR number).

Prior findings (from approved SHA ac8871abc) — still addressed: ✅ Bootstrap ordering, ✅ out field final, ✅ "0-" prefix for unknowns, ✅ Javadoc updated for mdep.

New finding — compile error in all three renamed files (must fix)

The rename commit updated the file names and the class declarations, but left the constructor names referencing the old class names. In Java, a constructor must have the same name as its enclosing class — mismatches are compile errors, not runtime issues.

  • MavenITgh11767ConsumerPomBomFromSettingsRepoTest has constructor MavenITConsumerPomBomFromSettingsRepoTest()
  • MavenITgh12625BomConsumerPomPropertyResolutionTest has constructor MavenITBomConsumerPomPropertyResolutionTest()
  • MavenITgh12922MvnupToolchainPluginStrategyTest has constructor public MavenITMvnupToolchainPluginStrategyTest()

All three need their constructor names updated to match the new class names.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...uite/src/test/java/org/apache/maven/it/MavenITgh11767ConsumerPomBomFromSettingsRepoTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...te/src/test/java/org/apache/maven/it/MavenITgh12625BomConsumerPomPropertyResolutionTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...-suite/src/test/java/org/apache/maven/it/MavenITgh12922MvnupToolchainPluginStrategyTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gnodet
fix: update constructor names to match renamed test classes
55b1c6a
gnodet-bot
gnodet-bot approved these changes Sep 18, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-review after commit 55b1c6af (fix constructor names to match renamed test classes).

Prior findings — status:

  • ✅ Bootstrap ordering (original finding, 2cad5a49): MavenITBootstrapTest returns "9-MavenITBootstrapTest", sorts first — correct.
  • ✅ Unknown-class prefix "0-" (b16207b4): Unknown classes sort last after descending reversal — correct.
  • ✅ Bootstrap check moved before pattern matching (b16207b4): Prevents a hypothetical future rename like MavenITBootstrap42Test from matching IT_PATTERN.
  • ✅ out field final (ac8871ab): private static final PrintStream out.
  • ✅ Javadoc updated for mdep category (ac8871ab): Class-level Javadoc lists all four prefixes.
  • ✅ MDEP_PATTERN added + warning dedup (5a183545): MavenITmdep0590... now matched correctly; each unrecognized class name logged once.
  • ✅ Constructor names fixed (55b1c6af): All three renamed test classes now have constructors that match their class names — compile errors eliminated.

Pattern verification: Confirmed all four patterns are mutually exclusive — IT_PATTERN (.*MavenIT(\d+).*) does not match gh/mng/mdep prefixed classes, and MDEP_PATTERN correctly catches the only mdep-prefixed class in this branch.

Diff from master: The 4.0.x backport correctly retains the String-based Verifier constructor, the ExecutorHelper mode logging, and adds both MDEP_PATTERN and WARNED_CLASSES deduplication that master does not have. All adaptations are appropriate.

No remaining issues. ✅

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet
gnodet merged commit e5dbca7 into apache:maven-4.0.x Sep 18, 2026
22 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned gnodet Sep 18, 2026
@gnodet
gnodet deleted the backport/dynamic-test-suite-ordering-to-4.0.x branch October 26, 2026 07:30
@gnodet gnodet mentioned this pull request Nov 16, 2026
Validate metaversions and detect extension conflicts (fixes #11181) #11184
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cstamas cstamas cstamas approved these changes
+1 more reviewer
@gnodet-bot gnodet-bot gnodet-bot approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gnodet gnodet

Labels

maintenance

Projects

None yet

Milestone

4.0.0-rc-7

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@gnodet @cstamas @gnodet-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.