-
Notifications
You must be signed in to change notification settings - Fork 53
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
validate file based arguments point to existing files / directories #483
Conversation
if a File based paramter is set (excluding workingDir which we create) then parsing the arg will fail early rather than continuing and then erroring (or silently swallowing it) later in the run fixes #449
baeaff5
to
943a678
Compare
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.
Very nice
/** | ||
* Converter that converts to a File that must exist (either as a directory or a file) | ||
*/ | ||
public class ExistingFileTypeConverter implements ITypeConverter<File> { |
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.
a more "rich" solution would have been to use JSR-380 based validation - this would pull in more code and still requires us to write a customer validator.
@@ -57,7 +58,8 @@ public class PluginCompatTesterCli implements Callable<Integer> { | |||
@CommandLine.Option( | |||
names = {"-w", "--war"}, | |||
required = true, | |||
description = "Path to the WAR file to be used by the PCT.") | |||
description = "Path to the WAR file to be used by the PCT.", | |||
converter = ExistingFileTypeConverter.class) |
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.
whilst we could have set the default, workingDir
would need to be default and we can not reference the default converters so would need yet another class.
@CommandLine.Option( | ||
names = "--mvn", | ||
description = "The path to the Maven executable.", | ||
converter = ExistingFileTypeConverter.class) |
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.
arguably this is incorrect but we already call getAbosultePath
so we can not pass in something that we expect to be on the path.
java17 build seems to be failing in the smoke test with This smells like a used to much memory and I killed you issue. given we are using multiple JVMs (maven, surefire, running the pct which runs maven and builds....) I expect we have an unconstrained JVM or 2 in the loop. |
39c6d25
to
ffe0035
Compare
ffe0035
to
7be7b5e
Compare
@@ -0,0 +1 @@ | |||
-Xmx128m -XX:+HeapDumpOnOutOfMemoryError -XX:+TieredCompilation -XX:TieredStopAtLevel=1 |
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.
constrain the maven jvm memory. and don't attempt to to expensive JITing for a short lived process.
no profiling has been done - tested with 64m
with mvn clean install
and the build ran, doubled it for good measure
PluginCompatTesterTest runs the PCT which will run various maven. if the JVM is not configured (its not for the text-finder) | ||
then we run a JVM that seems the host/container memory and assumes it is the only thing running leading to it being OOMKilled | ||
--> | ||
<MAVEN_OPTS>-Xmx256m -XX:+TieredCompilation -XX:TieredStopAtLevel=1</MAVEN_OPTS> |
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.
64m
caused OOMexceptions, 128 was ok, doubled that number.
@@ -296,9 +297,18 @@ | |||
<artifactId>maven-surefire-plugin</artifactId> | |||
<!-- Version specified in parent POM --> | |||
<configuration> | |||
<argLine>@{argLine} -Xmx128m -XX:+HeapDumpOnOutOfMemoryError -XX:+TieredCompilation -XX:TieredStopAtLevel=1</argLine> |
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.
surefire is runnning the PCT code - no profiling has been performed.
--> | ||
<MAVEN_OPTS>-Xmx256m -XX:+TieredCompilation -XX:TieredStopAtLevel=1</MAVEN_OPTS> | ||
</environmentVariables> | ||
<reuseForks>false</reuseForks> |
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 PluginCompatTesterTest
runs first which consumes the most amount of memory.
adds a little onto the build time - but for the sake of stable builds this is eaten up into the time for the smoke test.
if a File based paramter is set (excluding workingDir which we create) then parsing the arg will fail early rather than continuing and then erroring (or silently swallowing it) later in the run
fixes #449
tested with various arg combintions with option args present and valid, not present, and present and invalid