Skip to content

Keep the Maven classpath container when the PDE classpath is updated - #2265

Closed
RoiSoleil wants to merge 1 commit into
eclipse-m2e:mainfrom
RoiSoleil:fix-flaky-tests
Closed

RoiSoleil wants to merge 1 commit into
eclipse-m2e:mainfrom
RoiSoleil:fix-flaky-tests

Conversation

@RoiSoleil

@RoiSoleil RoiSoleil commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

TychoConnectorTest.importTychoPlugin randomly fails on most pull requests with:

M2EClasspath Container not found! (…JRE_CONTAINER…, org.eclipse.pde.core.requiredPlugins, /pde.tycho.plugin/src/

This is not a test problem but a bug in the PDE connector.

If the plug-in model of a Tycho project is not available yet when the project is configured, PDEProjectHelper computes its PDE classpath later, once PDE has loaded the model (CLASSPATH_UPDATER). That update replaces the whole raw classpath by the one computed by PDE ("clear existing entries"), so it removes the Maven classpath container the Java configurator added in the meantime. Whether the model is available in time depends on PDE's resource change listener, hence the random failures — and the container is really lost for the user in that case.

The Maven classpath container of the project is now kept when its PDE classpath is set.

Testing

PDEProjectHelperTest (new) runs the deferred update on an imported project. Without the fix it fails with exactly the classpath reported by the CI failures; with it, all the tests of org.eclipse.m2e.pde.connector.tests pass locally on Linux.

The two other test fixes initially part of this PR are now in #2266 (ConsoleTest) and #2267 (MavenTargetDependencyEditorTest).

🤖 Generated with Claude Code

https://claude.ai/code/session_01SscofYwGFw413Xrn8R2AUq

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Test Results

  351 files    351 suites   1h 19m 22s ⏱️
  732 tests   716 ✅ 16 💤 0 ❌
2 196 runs  2 148 ✅ 48 💤 0 ❌

Results for commit 282c99c.

♻️ This comment has been updated with latest results.

@laeubi

laeubi commented Oct 8, 2026

Copy link
Copy Markdown
Member

@RoiSoleil would you mind to create one PR for each of the proposed test fixes? That would make it easier to review and possibly merge in isolation.

@RoiSoleil RoiSoleil changed the title Fix three randomly failing tests (Tycho classpath container, ConsoleTest, MavenTargetDependencyEditorTest) Keep the Maven classpath container when the PDE classpath is updated Oct 8, 2026
@RoiSoleil

Copy link
Copy Markdown
Contributor Author

@laeubi Sure, done:

The three are independent of each other.

If the plug-in model of a Tycho project is not available yet when the
project is configured, PDEProjectHelper computes its PDE classpath
later, once PDE has loaded the model. This update replaced the whole
raw classpath by the one computed by PDE and so removed the Maven
classpath container the Java configurator had added in the meantime.

Whether the model is available in time depends on PDE's resource
change listener, which is why TychoConnectorTest.importTychoPlugin
randomly fails with "M2EClasspath Container not found!", the classpath
being the one computed by PDE (JRE, required plug-ins, sources).

The Maven classpath container of the project is now kept when its PDE
classpath is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SscofYwGFw413Xrn8R2AUq
@laeubi

laeubi commented Oct 8, 2026

Copy link
Copy Markdown
Member

Lets see how it behaves with the other failures fixed. The whole PDEHelper Code looks really brittle ... so I need to check the details in more depth.

@RoiSoleil

Copy link
Copy Markdown
Contributor Author

Looks like OK

@RoiSoleil RoiSoleil closed this Oct 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.

2 participants