Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
206 views
in Technique[技术] by (71.8m points)

java - Maven parallel test output

When I set my Maven build to run my integration tests in parallel, I see:

01:31:47 -------------------------------------------------------
01:31:47  T E S T S
01:31:47 -------------------------------------------------------
01:31:48 Concurrency config is parallel='classes', perCoreThreadCount=true, threadCount=20, useUnlimitedThreads=false

But then I don't see the progress of any of my tests. Eventually, they all finish and the output gets dumped out all at once.

01:41:42 Running com.my.test.TestClass
01:41:42 Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 69.706 sec
....

That test class finished after a minute yet it wasn't output until all the tests finished 10 minutes later.

How can I get the results of each class as it finishes to get output? It's hard to understand the progress of the build otherwise.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Hope, I've got your question right. I think that's because tests that are being running in parallel can't really use the same console to notify their own progress, not technically, but conceptually it doesn't really make sense. Since maven processes the modules concurrently it possible that 2 tests running simultaneously will "share" the console. You'll just get the garbage in an output.

So instead, I guess you should take a look only on the overall results in the console and go for reports per module.

Surefire plugin responsible for running the tests generates reports per test.

There is also surefire report plugin

Hope this helps


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...