You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mag Hoehme (JIRA)" <ji...@codehaus.org> on 2010/07/09 14:21:32 UTC
[jira] Created: (SUREFIRE-628) Parallel Execution: Output from
junit.framework.TestListener.endTest() is swallowed
Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
-----------------------------------------------------------------------------------
Key: SUREFIRE-628
URL: http://jira.codehaus.org/browse/SUREFIRE-628
Project: Maven Surefire
Issue Type: Bug
Components: Maven Surefire Plugin
Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
Reporter: Mag Hoehme
Attachments: surefire-output.tar.gz
I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
----------------------------------------------------------------------------------------
Testcase output (single-threaded execution): both messages are printed
----------------------------------------------------------------------------------------
Running mho.SimpleSuiteTest
>>> starting testcase mho.SimpleSuiteTest
### mho.SimpleSuiteTest:testError - ERROR
>>> finished testcase mho.SimpleSuiteTest, duration=0ms
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
Results :
Tests in error:
testError(mho.SimpleSuiteTest)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
----------------------------------------------------------------------------------------
Testcase output (parallel execution): second message is missing
----------------------------------------------------------------------------------------
Running mho.SimpleSuiteTest
>>> starting testcase mho.SimpleSuiteTest
### mho.SimpleSuiteTest:testError - ERROR
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
Results :
Tests in error:
testError(mho.SimpleSuiteTest)
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Issue Comment Edited: (SUREFIRE-628) Parallel Execution:
Output from junit.framework.TestListener.endTest() is swallowed
Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227925#action_227925 ]
Kristian Rosenvold edited comment on SUREFIRE-628 at 7/10/10 9:30 AM:
----------------------------------------------------------------------
Made a partial fix in r962846
Console output is now not discarded, The "static" output from a test run is output at the end, and in no particular order wrt the test methods.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods" and "both", I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
was (Author: krosenvold):
Made a partial fix in r962846
Console output is now not discarded, The "static" output from a test run is output at the end, and not in correct order.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods" and "both", I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
> Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
> -----------------------------------------------------------------------------------
>
> Key: SUREFIRE-628
> URL: http://jira.codehaus.org/browse/SUREFIRE-628
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
> Reporter: Mag Hoehme
> Attachments: surefire-output.tar.gz
>
>
> I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
> When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
> ----------------------------------------------------------------------------------------
> Testcase output (single-threaded execution): both messages are printed
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> >>> finished testcase mho.SimpleSuiteTest, duration=0ms
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> ----------------------------------------------------------------------------------------
> Testcase output (parallel execution): second message is missing
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SUREFIRE-628) Parallel Execution: Output from
junit.framework.TestListener.endTest() is swallowed
Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227925#action_227925 ]
Kristian Rosenvold commented on SUREFIRE-628:
---------------------------------------------
Made a partial fix in r962846
Console output is now not discarded, but output before and after tests is not written in the correct order, nor particularly in relation to the test in question. The "static" output from a test run is output at the end.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods" and "both", I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
> Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
> -----------------------------------------------------------------------------------
>
> Key: SUREFIRE-628
> URL: http://jira.codehaus.org/browse/SUREFIRE-628
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
> Reporter: Mag Hoehme
> Attachments: surefire-output.tar.gz
>
>
> I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
> When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
> ----------------------------------------------------------------------------------------
> Testcase output (single-threaded execution): both messages are printed
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> >>> finished testcase mho.SimpleSuiteTest, duration=0ms
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> ----------------------------------------------------------------------------------------
> Testcase output (parallel execution): second message is missing
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (SUREFIRE-628) Parallel Execution: Output from
junit.framework.TestListener.endTest() is swallowed
Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Rosenvold closed SUREFIRE-628.
---------------------------------------
Resolution: Fixed
Fix Version/s: 2.6
Assignee: Kristian Rosenvold
We are unable to do anything about output that is not associated with a test because making assumptions about this would have severe implications for embedded use. Therefore, test output that cannot be associated with a testcase will just float right out to the console and the fix that was made for 2.6 is the end of this issue.
> Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
> -----------------------------------------------------------------------------------
>
> Key: SUREFIRE-628
> URL: http://jira.codehaus.org/browse/SUREFIRE-628
> Project: Maven Surefire
> Issue Type: Bug
> Components: Junit 4.7+ (parallel) support
> Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
> Reporter: Mag Hoehme
> Assignee: Kristian Rosenvold
> Fix For: 2.6
>
> Attachments: surefire-output.tar.gz
>
>
> I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
> When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
> ----------------------------------------------------------------------------------------
> Testcase output (single-threaded execution): both messages are printed
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> >>> finished testcase mho.SimpleSuiteTest, duration=0ms
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> ----------------------------------------------------------------------------------------
> Testcase output (parallel execution): second message is missing
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (SUREFIRE-628) Parallel Execution: Output from
junit.framework.TestListener.endTest() is swallowed
Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Rosenvold updated SUREFIRE-628:
----------------------------------------
Component/s: (was: Maven Surefire Plugin)
Junit 4.7+ (parallel) support
> Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
> -----------------------------------------------------------------------------------
>
> Key: SUREFIRE-628
> URL: http://jira.codehaus.org/browse/SUREFIRE-628
> Project: Maven Surefire
> Issue Type: Bug
> Components: Junit 4.7+ (parallel) support
> Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
> Reporter: Mag Hoehme
> Attachments: surefire-output.tar.gz
>
>
> I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
> When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
> ----------------------------------------------------------------------------------------
> Testcase output (single-threaded execution): both messages are printed
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> >>> finished testcase mho.SimpleSuiteTest, duration=0ms
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> ----------------------------------------------------------------------------------------
> Testcase output (parallel execution): second message is missing
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Issue Comment Edited: (SUREFIRE-628) Parallel Execution:
Output from junit.framework.TestListener.endTest() is swallowed
Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227925#action_227925 ]
Kristian Rosenvold edited comment on SUREFIRE-628 at 7/10/10 3:12 PM:
----------------------------------------------------------------------
Made a partial fix in r962846
Console output is now not discarded, The "static" output from a test run is output at the end, and in no particular order wrt the test methods.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods", it seems like all the static test methods are run sequentially on the main thread before threading is started, so it should possible to record and associate this with the correct test. As for "both" I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will gladly review any patches received to further improve this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
was (Author: krosenvold):
Made a partial fix in r962846
Console output is now not discarded, The "static" output from a test run is output at the end, and in no particular order wrt the test methods.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods", it seems like all the static test methods are run sequentially on the main thread before threading is started, so it should possible to record and associate this with the correct test. As for "both" I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
> Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
> -----------------------------------------------------------------------------------
>
> Key: SUREFIRE-628
> URL: http://jira.codehaus.org/browse/SUREFIRE-628
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
> Reporter: Mag Hoehme
> Attachments: surefire-output.tar.gz
>
>
> I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
> When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
> ----------------------------------------------------------------------------------------
> Testcase output (single-threaded execution): both messages are printed
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> >>> finished testcase mho.SimpleSuiteTest, duration=0ms
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> ----------------------------------------------------------------------------------------
> Testcase output (parallel execution): second message is missing
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Issue Comment Edited: (SUREFIRE-628) Parallel Execution:
Output from junit.framework.TestListener.endTest() is swallowed
Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227925#action_227925 ]
Kristian Rosenvold edited comment on SUREFIRE-628 at 7/10/10 9:29 AM:
----------------------------------------------------------------------
Made a partial fix in r962846
Console output is now not discarded, The "static" output from a test run is output at the end, and not in correct order.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods" and "both", I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
was (Author: krosenvold):
Made a partial fix in r962846
Console output is now not discarded, but output before and after tests is not written in the correct order, nor particularly in relation to the test in question. The "static" output from a test run is output at the end.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods" and "both", I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
> Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
> -----------------------------------------------------------------------------------
>
> Key: SUREFIRE-628
> URL: http://jira.codehaus.org/browse/SUREFIRE-628
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
> Reporter: Mag Hoehme
> Attachments: surefire-output.tar.gz
>
>
> I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
> When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
> ----------------------------------------------------------------------------------------
> Testcase output (single-threaded execution): both messages are printed
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> >>> finished testcase mho.SimpleSuiteTest, duration=0ms
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> ----------------------------------------------------------------------------------------
> Testcase output (parallel execution): second message is missing
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (SUREFIRE-628) Parallel Execution: Output from
junit.framework.TestListener.endTest() is swallowed
Posted by "Mag Hoehme (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227837#action_227837 ]
Mag Hoehme commented on SUREFIRE-628:
-------------------------------------
The reason for this behaviour seems to be as follows:
In class ConcurrentPrintStream.write(byte[], int, int), TestMethod.getThreadTestMethod() returns null when the endTest()-statement from the TestListener is printed. In this case, printing is delegated to the ByteArrayOutputStream out, which is never printed.
> Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
> -----------------------------------------------------------------------------------
>
> Key: SUREFIRE-628
> URL: http://jira.codehaus.org/browse/SUREFIRE-628
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
> Reporter: Mag Hoehme
> Attachments: surefire-output.tar.gz
>
>
> I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
> When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
> ----------------------------------------------------------------------------------------
> Testcase output (single-threaded execution): both messages are printed
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> >>> finished testcase mho.SimpleSuiteTest, duration=0ms
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> ----------------------------------------------------------------------------------------
> Testcase output (parallel execution): second message is missing
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Issue Comment Edited: (SUREFIRE-628) Parallel Execution:
Output from junit.framework.TestListener.endTest() is swallowed
Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/SUREFIRE-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227925#action_227925 ]
Kristian Rosenvold edited comment on SUREFIRE-628 at 7/10/10 11:07 AM:
-----------------------------------------------------------------------
Made a partial fix in r962846
Console output is now not discarded, The "static" output from a test run is output at the end, and in no particular order wrt the test methods.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods", it seems like all the static test methods are run sequentially on the main thread before threading is started, so it should possible to record and associate this with the correct test. As for "both" I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
was (Author: krosenvold):
Made a partial fix in r962846
Console output is now not discarded, The "static" output from a test run is output at the end, and in no particular order wrt the test methods.
It should be possible to improve this, most notably for run-mode "classes" it should be possible to attach the TestSet to the Thread much the same way as we attach the TestMethod. For "methods" and "both", I think the best that can be done is to do /all/ the beforeclass stuff *before* the test run and *all* the afterClass stuff after the test runs.
I will not be giving further improvement of this any priority, but I will gladly review any patches received for this. The IT for surefire-628 should be extendable to verify the proper order.
Anyone wishing to experiment with this can do the following:
In directory:
surefire/surefire-integration-tests/src/test/resources/surefire-628-consoleoutputbeforeandafterclass
Run commands tests like this:
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=methods clean test
mvn -Dsurefire.version=2.6-SNAPSHOT -Djunit.parallel=classes clean test
You should be able to test & observe the effects of any patch ;)
Deployed updated 2.6-SNAPSHOT
> Parallel Execution: Output from junit.framework.TestListener.endTest() is swallowed
> -----------------------------------------------------------------------------------
>
> Key: SUREFIRE-628
> URL: http://jira.codehaus.org/browse/SUREFIRE-628
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Environment: Windows/Cygwin, self-compiled version of the surefire-plugin 2.6-SNAPSHOT
> Reporter: Mag Hoehme
> Attachments: surefire-output.tar.gz
>
>
> I am using a junit.framework.TestListener to print some bookkeeping information on System.out before and after the testcase.
> When executed single-threaded, everything works fine, and I am getting both messages before and after the testcase. In parallel, only the message before the start of testcase is printed, while the message after the testcase disappears.
> ----------------------------------------------------------------------------------------
> Testcase output (single-threaded execution): both messages are printed
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> >>> finished testcase mho.SimpleSuiteTest, duration=0ms
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.062 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
> ----------------------------------------------------------------------------------------
> Testcase output (parallel execution): second message is missing
> ----------------------------------------------------------------------------------------
> Running mho.SimpleSuiteTest
> >>> starting testcase mho.SimpleSuiteTest
> ### mho.SimpleSuiteTest:testError - ERROR
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.031 sec <<< FAILURE!
> Results :
> Tests in error:
> testError(mho.SimpleSuiteTest)
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira