Re: 'mvn clean test' crashes

2020-10-09 Thread Mukul Gandhi
On Wed, Oct 7, 2020 at 9:09 PM Enrico Olivelli  wrote:

> A good approach to workaround the presence of third party libraries that
> call System.exit is to set a SecurityManager that prevents calls to
> System.exit.


I'll find it helpful, if you may share any code sample how to do this?



-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-10-07 Thread Mukul Gandhi
Hi Tibor,

On Wed, Sep 30, 2020 at 5:03 PM Tibor Digana  wrote:

> Usually these errors appear in the test itself or the *libraries*.
> As for instance, we found out that a Spring's library is implementing Kafka
> stuff calling the "Runtime.getRuntime().halt(  )".
> The same bad thing is to call the "System.exit()".
> I have recognized this situation after I saw a crashed test in your logs.
> The test is supposed to be crashed if the execution breaks abruptly without
> receiving a JUnit/TestNG event about finishing the test, see this log:
>
> *[ERROR] Crashed tests: [ERROR] com.haldiram.business.helper.t*
> *est.SuspiciousActivityHelperTe**st*
>

Nowhere within my code (that's been tested by junit) and within my unit
tests, I've used things like 'Runtime.getRuntime().halt' or 'System.exit'.

The following within the logs that I've shared,

(i.e *[ERROR] Crashed tests: [ERROR] com.haldiram.business.helper.t*
*est.SuspiciousActivityHelperTe**st*)

that you've cited, doesn't indicate any of the things like use
of 'Runtime.getRuntime().halt' or 'System.exit'. For the information, the
name 'SuspiciousActivityHelper' is a business name within my application,
and is not anything related to technical suspicious aspects within my
application or test codebases.

The issues that I've discussed within this thread, still causes the same
problems to me.




-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-07-28 Thread Mukul Gandhi
On Tue, Jul 7, 2020 at 5:49 PM Gary Gregory  wrote:

> I've tried to deal with JVM crashes in the FailSafe (I was not having the
> problem in SureFire) plugin by using:
>
>   
> org.apache.maven.plugins
> maven-failsafe-plugin
> ${hmp.failsafe.version}
> 
>   1
>   false
> 
>   
>

I also ran the command 'mvn verify', by exactly specifying above within my
Maven project's pom.xml file (and specifying the version
as 3.0.0-M5), and got the same kind of build failure
errors, as I've mentioned in my previous post on this list.

Any further thoughts, about how to solve the problems I'm facing as
specified within this thread, would be appreciated.



-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-07-27 Thread Mukul Gandhi
43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)

Before I faced above failure, lot may tests within my Maven project passed.
I would expect, build success instead.

For above mentioned work, I've been following the instructions here,
https://maven.apache.org/surefire/maven-failsafe-plugin/usage.html.

Any thoughts, what I could do next, to continue with this work successfully?



-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-07-07 Thread Mukul Gandhi
Hi Gary,

On Sun, Jul 5, 2020 at 6:52 PM Gary Gregory  wrote:

You could try to set the fork count to 1.
>

As per Maven documentation, 'The default setting is
forkCount=1/reuseForks=true'. Even when I explicitly specify these values
within my Maven project's pom, I get the same build error that I mentioned
originally within this thread. forkCount=1/reuseForks=false also doesn't
work for me and fails my build with same sorts of error.

I also don't wish to specify value of forkCount greater than 1, since I
don't want my Maven project tests to run parallely. Because, most of my
tests interact transactionally with a DB, and I believe parallel test
execution would be problematic for my case.

Any further thoughts would be useful to me.




-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-07-05 Thread Mukul Gandhi
Hi Tibor,

On Sun, Jul 5, 2020 at 6:57 PM Tibor Digana  wrote:

> We do not provide a support.


I understand that, and I don't assume assured support.

Refering to the page, https://maven.apache.org/users/getting-help.html which
says following,

   Ask on the user list
   Our community is very helpful, just ask it the right way. See the
references section, at the end of this page, for info on how to do that.
Subscribe to the users-list and describe your problem   there. Don't
expect to get an answer right away. Sometimes it takes a couple of days.


In spirit of the above referred quote, I'm seeking help on this list.


> See the message properly. The test reports and dump files.
>

Definetely, I'll do that to try figuring the reason of the issues I'm
facing.



-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-07-02 Thread Mukul Gandhi
Hi Gary,

On Wed, Jul 1, 2020 at 4:26 PM Gary Gregory  wrote:

> Have you tried the more recent version of the Maven surefire plugin?
>

I'm using Maven 3.6.3.

I changed to the latest stable version of Maven surefire plugin (3.0.0-M5),
and its producing the same build error. I was using Maven surefire plugin
version 2.22.2 earlier.

I've also debugged along the lines of latest comment by Bernd, with regards
to available RAM on my Windows dev workstation. I've total RAM of 8 GB.
Originally, I was working with default settings for -Xmx on MAVEN_OPTS
environment variable (which I guess has value 512 MB). I changed that to 3
GB, and my workstation's total RAM usage is well below 100% (it hovers
around 70%) during my entire run of command 'mvn clean test', and I get
same test case crash.

I've also found related information at,
https://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html.
At the bottom of this link, following is mentioned,

Crashed forked JVM caused listing the crashed test(s)

After the JVM exited abruptly, the console lists the message Crashed tests:
with a list of crashed tests if the entire test-set has not been yet
completed. This happens if a test exited, killed JVM or a segmentation
fault crashed JVM. In such cases you may be interested in dump files
generated in reports directory, see FAQ.


When I read the FAQ (the last word within above 'quote'), and according to
that information, I see following hint in the
file 2020-07-02T11-58-54_573.dumpstream (there are no other dump files
created during my run of 'mvn clean test'),
*Boot Manifest-JAR contains absolute paths in classpath
'F:\eclipseWorkspaces\haldiram_backend_sprint-19_sts\haldiram-backend\haldiram-restapis\target\test-classes'*
*Hint:
-Djdk.net.URLClassPath.disableClassPathURLCheck=true*

According to above referred hint, I then ran the following command,
mvn clean test -Djdk.net.URLClassPath.disableClassPathURLCheck=true

But this produced the same error (although, this time the mvn test process
crashed on a different test file than what I experienced originally).

Any thoughts, what I could do next on my Windows dev workstation to solve
the problem I've mentioned in this thread?



-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-07-01 Thread Mukul Gandhi
Hi Enrico,

On Wed, Jul 1, 2020 at 1:13 PM Enrico Olivelli  wrote:

> I suggest you to debug that test, with an IDE or just by adding some
> System.out.println
>

When I run only the tests present in offending java class
(com.haldiram.business.helper.test.ApplnHelperTest), from within the IDE,
all the tests in the class pass.

But, when I run all the tests present within my aggregated Maven project
(multi module Maven project), using the command 'mvn clean test', the Maven
build failure says following,

[ERROR] Crashed tests:
[ERROR] com.haldiram.business.helper.test.ApplnHelperTest
[ERROR] at
org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:669)
[ERROR] at
org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282)
[ERROR] at
org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245)
...

All of the above, were done on a Windows workstation.

Also, when a Jenkins build pipeline invokes the command 'mvn clean test' on
a Linux system for all of my same codebase, all the tests pass and Maven
build succeeds there.

I've a strong feeling that, all my unit tests have no issues from the tests
code perspective. I feel, there could be some other issue, that I'm unable
to solve at this moment. Any further pointers to solve the issues I've
mentioned in this thread would be welcome.




-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-07-01 Thread Mukul Gandhi
Hi Enrico,

On Wed, Jul 1, 2020 at 11:34 AM Enrico Olivelli  wrote:

> Can you try to run one test at a time and see which test is crashing your
> build?
>
> Use
> mvn test -Dtest=NameOfTheTestClass
>

When I run all my tests, with command 'mvn clean test', my build failed
with following message,

[ERROR] Crashed tests:
[ERROR] com.haldiram.business.helper.test.ApplnHelperTest
...

When I run only the tests present in class
com.haldiram.business.helper.test.ApplnHelperTest, with following command,

mvn clean test -Dtest=com.haldiram.business.helper.test.ApplnHelperTest

The Maven build emits following error,

[INFO] BUILD FAILURE
[INFO]

[INFO] Total time:  24.624 s
[INFO] Finished at: 2020-07-01T12:56:40+05:30
[INFO]

[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test)
on project Verimployee-core: No tests were executed!  (Set
-DfailIfNoTests=false to ignore this error.)

Therefore, I run the above command as follows,

mvn clean test
-Dtest=com.haldiram.business.helper.test.ApplnHelperTest -DfailIfNoTests=false

And all the tests present in class
com.haldiram.business.helper.test.ApplnHelperTest pass, and the Maven build
succeeds.

My problem, that I described originally in this thread, still remains. I
hope, someone may help me further on this issue.




-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-06-30 Thread Mukul Gandhi
Hi Bernd,

On Wed, Jul 1, 2020 at 10:50 AM Bernd Eckenfels 
wrote:

> Anything in the mentioned dump files?


When my command, 'mvn clean test' finishes (with an error that I mentioned
earlier), there are no file(s) with name *.dump* created on my workstation
(I'm looking, within my Maven project folder tree).


> Could be a environment variable problem or corrupted Java Home (less
> likely a problem in the test code).
>

I'm not sure, how to debug as per these aspects.

You can also try to specify -DskipTests to see if the rest of the Maven
> build works.
>

The command 'mvn clean package -DskipTests' results in successful build for
me.




-- 
Regards,
Mukul Gandhi


Re: 'mvn clean test' crashes

2020-06-30 Thread Mukul Gandhi
Hi Enrico,

On Wed, Jul 1, 2020 at 10:47 AM Enrico Olivelli  wrote:


> Are you walking System.exit or System.halt in your tests?
>

I'm not using either of System.exit or System.halt within my tests code.
I'm also neither, using these two statements within my business logic code.



-- 
Regards,
Mukul Gandhi


'mvn clean test' crashes

2020-06-30 Thread Mukul Gandhi
her.java:225)
[ERROR] at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)


I'll be grateful, if anyone may please guide me why 'mvn clean test'
command is failing for me as per error trace mentioned above, and how to
fix it.




-- 
Regards,
Mukul Gandhi