Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display-plugin-updates-005 and -006 fail with maven older than 3.8.4 #850

Closed
jarmoniuk opened this issue Dec 14, 2022 · 7 comments
Closed

Comments

@jarmoniuk
Copy link
Contributor

jarmoniuk commented Dec 14, 2022

While working on #848 I've noticed that the project is very sensitive to concurrency issues. Integration tests often fail when run multi-threaded. To be checked and sanitized.

By the way, this is a very old issue, a comment regarding that has been sitting in pom.xml for quite some time now.

@jarmoniuk jarmoniuk changed the title Concurrency issues Old issue: integration tests often fail when run multithreaded Dec 14, 2022
@jarmoniuk
Copy link
Contributor Author

@slawekjaranowski
Copy link
Member

Some clarification of how invoker works.

For each project / test invoker execute new process by command line.

Sow when we use parallelThreads > 1 we have multiple independent system process at the same time it is not multithreaded execution.

Each versions-m-p test can interact with local Maven repository which is not synchronized by multi process.

@jarmoniuk
Copy link
Contributor Author

In that case this is something I observe on my machine only; and I see it's not limited to parallel use of the invoker.

In many runs, it-display-plugin-updates-005, it-display-plugin-updates-006, it-rules-via-wagon-001 (which uses the display plugin updates mojo), all fail on an NPE at https://github.com/mojohaus/versions/blob/master/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java#L623

because one of the versions is null, which boils down to the plugin version being null and the parentVersions not containing the version for the plugin. Looking for the root cause of that.

@slawekjaranowski
Copy link
Member

We can use invoker.ordinal to try sort, group, isolate tests

https://maven.apache.org/plugins/maven-invoker-plugin/examples/parallel-projects-execution.html

@jarmoniuk
Copy link
Contributor Author

jarmoniuk commented Dec 18, 2022

Managed to produce the problem consistently using Maven 3.2.5.
bad.log

The problem appears not to occur on Maven 3.8.6.
good-3.8.6.log

@jarmoniuk
Copy link
Contributor Author

jarmoniuk commented Dec 18, 2022

In version 3.8.6, the version of dummy-maven-plugin is resolved to 3.1.

[DEBUG] Resolved plugin version for localhost:dummy-maven-plugin to 3.1 from repository mrm-maven-plugin (http://localhost:50095, default, releases+snapshots)

In the older version however, it doesn't get resolved. I don't know how much consistent that is. I haven't checked how that resolution is done exactly (DefaultPluginVersionResolver from maven-core), but that might depend on the version of Maven.

The latest version of Maven when the problem occurs is 3.8.3. It appears to have been fixed in 3.8.4.

@jarmoniuk jarmoniuk changed the title Old issue: integration tests often fail when run multithreaded display-plugin-updates-005 and -006 fail with maven older than 3.8.4 Dec 18, 2022
@jarmoniuk
Copy link
Contributor Author

jarmoniuk commented Dec 18, 2022

I think it is quite safe to mitigate (I am specifically not using the term "fix") the problem by using String.valueOf instead of simply dereferencing the String object which may be null. The result is then:

[INFO] Require Maven 3.8.4 to use the following plugin updates:
[INFO]   localhost:dummy-maven-plugin .......................... null -> 3.1

jarmoniuk added a commit to jarmoniuk/versions-maven-plugin that referenced this issue Dec 18, 2022
…inst a NPE in case the effective version of a plugin is not specified
jarmoniuk added a commit to jarmoniuk/versions-maven-plugin that referenced this issue Dec 18, 2022
…inst a NPE in case the effective version of a plugin is not specified
slawekjaranowski pushed a commit that referenced this issue Dec 18, 2022
…PE in case the effective version of a plugin is not specified
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

No branches or pull requests

2 participants