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
andrzejj0 opened this issue Dec 14, 2022 · 7 comments
Closed

Comments

@andrzejj0
Copy link
Contributor

andrzejj0 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.

@andrzejj0 andrzejj0 changed the title Concurrency issues Old issue: integration tests often fail when run multithreaded Dec 14, 2022
@andrzejj0
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.

@andrzejj0
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

@andrzejj0
Copy link
Contributor Author

andrzejj0 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

@andrzejj0
Copy link
Contributor Author

andrzejj0 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.

@andrzejj0 andrzejj0 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
@andrzejj0
Copy link
Contributor Author

andrzejj0 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

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