You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "S Daigle (JIRA)" <ji...@codehaus.org> on 2011/02/23 01:25:24 UTC

[jira] Created: (SUREFIRE-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
-------------------------------------------------------------------------------------------------------------------------------------

                 Key: SUREFIRE-704
                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
             Project: Maven Surefire
          Issue Type: Bug
          Components: Junit 4.x support
    Affects Versions: 2.7.2
         Environment: Windows/Linux/SunOS
            Reporter: S Daigle
         Attachments: surefire.txt

We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.

When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]

Please see the attachment for full "mvn -e test" output.

If we set the redirectTestOutputToFile to false, it works but we need this option set to true.

Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S Daigle updated SUREFIRE-704:
------------------------------

    Attachment: sf-pom-config.txt

Thanks again Kristian. I attached our surefire plugin config for you.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=257957#action_257957 ] 

Kristian Rosenvold commented on SUREFIRE-704:
---------------------------------------------

I have isolated the cause of this issue and it happens because the last line being printed to System.out/err does not contain a linefeed.

So as a temporary fix until 2.8 is released, you can add a linefeed after the last test before finishing each test class:

    @AfterClass
    public static void tempFix(){
       System.out.println();
        System.err.println();
    }


> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Chad Wilson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=263648#action_263648 ] 

Chad Wilson commented on SUREFIRE-704:
--------------------------------------

Apologies Kristian, I missed your reply earlier. However we've now using the updated plexus-utils and things seem to be better - thanks!

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire-272.txt, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258098#action_258098 ] 

S Daigle commented on SUREFIRE-704:
-----------------------------------

We were able to add the temporary workaround to some of our files to get by these issues. Thanks for your help Kristian. Since 2.7.3 has not been officially released, do you know when 2.8 might be available?

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire-272.txt, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Chad Wilson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=263809#action_263809 ] 

Chad Wilson commented on SUREFIRE-704:
--------------------------------------

Alas, I spoke too soon. Getting random failures again today with surefire and failsafe 2.7.2 despite plexus-utils:2.0.7 on both plugins. :(

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire-272.txt, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Rosenvold closed SUREFIRE-704.
---------------------------------------

    Resolution: Fixed

Extended IT and fixed piggybacked bug report in r1104433, updated snapshot published. It is generally easier to keep track of what is opened/closed at any given time if you create new issues for different problems, even if the version is not yet released.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=257900#action_257900 ] 

Kristian Rosenvold commented on SUREFIRE-704:
---------------------------------------------

Are you sure you got this exact message with 2.7.2 ? It was fixed for 2.7.2, but we have a *similar* issue (SUREFIRE-690) that has a slightly different error message that will be fixed for 2.7.3. The only known workaround at the moment is to insert a minor Thread.sleep() in an @after method for tests that write a lot to console. And 690 is targeted for 2.7.3 (will be 2.8)

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Chad Wilson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258150#action_258150 ] 

Chad Wilson commented on SUREFIRE-704:
--------------------------------------

It's possible that this is spurious (and it certainly seems bizarre) but we started getting failures with one of our tests after we added a relatively simple @Setup to the test. Even more strangely, re-ordering the @Tests in the file so that the two tests (of 4) that were logging an exception stacktrace via log4j weren't last in the file seemed to fix it as well. The mind boggles.

We have the same Maven setup as S Daigle.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire-272.txt, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Chad Wilson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267443#action_267443 ] 

Chad Wilson commented on SUREFIRE-704:
--------------------------------------

Hi Kristian - did the fix to this involve a fix that would have restored sys out and sys err messages being included in the XML reports? We've noticed that in 2.8 and 2.8.1 the std-out and std-err sections were not being included in the XML test reports for failures - which stopped TeamCity from being able to include them in test failure reports. The behaviour from 2.7.2 seems to be restored in 2.8.2-SNAPSHOT though.

Additionally, is it perhaps related to http://jira.codehaus.org/browse/SUREFIRE-725 ?

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S Daigle updated SUREFIRE-704:
------------------------------

    Attachment: surefire-failure.log

Hi Kristian,

Using the 2.8.2-SNAPSHOT version of the surefire plugin is much better but we still see these errors when tests post a large amount of stdout/stderr to the output files. Please see the attached log for more information. 

Thanks again


> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: surefire-272.txt, surefire-failure.log, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Chad Wilson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258150#action_258150 ] 

Chad Wilson edited comment on SUREFIRE-704 at 3/2/11 12:28 AM:
---------------------------------------------------------------

It's possible that this is spurious (and it certainly seems bizarre) but we started getting failures with one of our tests after we added a relatively simple @Setup to the test. Even more strangely, re-ordering the @Tests in the file so that the two tests (of 4) that were logging an exception stacktrace via log4j weren't last in the file seemed to fix it as well. (The other two tests don't log anything at all) The mind boggles.

We have the same Maven setup as S Daigle.

      was (Author: voiceinsideyou):
    It's possible that this is spurious (and it certainly seems bizarre) but we started getting failures with one of our tests after we added a relatively simple @Setup to the test. Even more strangely, re-ordering the @Tests in the file so that the two tests (of 4) that were logging an exception stacktrace via log4j weren't last in the file seemed to fix it as well. The mind boggles.

We have the same Maven setup as S Daigle.
  
> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire-272.txt, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S Daigle updated SUREFIRE-704:
------------------------------

    Attachment: surefire-272.txt

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire-272.txt, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267151#action_267151 ] 

S Daigle commented on SUREFIRE-704:
-----------------------------------

Thanks Kristian. Somehow our Nexus server toggled our Apache Snapshots to blocking so we were not pulling in the latest SNAPSHOT versions. I corrected this so we'll see how it goes. Thanks again for your help.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: surefire-272.txt, surefire-failure.log, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S Daigle updated SUREFIRE-704:
------------------------------

    Attachment: stack.txt
                test-out.txt

Hi Kristian. Now that we're using the latest 2.8.2-SNAPSHOT version of the plugin, were seeing the following errors in some of our tests. For example, this happened with a System.err.println("foo");

java.lang.NullPointerException
                at org.apache.maven.surefire.report.ConsoleOutputCapture$ForwardingPrintStream.println(ConsoleOutputCapture.java:84)
                at com.attivio.special.client.AttivioDocumentClientTest.getBatchingDocumentClient(AttivioDocumentClientTest.java:65)
                at com.attivio.special.client.AttivioDocumentClientTest.batchingDocumentTest(AttivioDocumentClientTest.java:78)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Do you know what this is? I attach the stack.txt and test-out.txt logfiles so you have more information.
Thanks

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267271#action_267271 ] 

S Daigle commented on SUREFIRE-704:
-----------------------------------

Thanks so much Kristian for the quick turnaround on this. I tested your changes and no more errors. I'll remember to open new issues in the future. Thanks again for all your help with this plugin.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=257959#action_257959 ] 

S Daigle commented on SUREFIRE-704:
-----------------------------------

Hi Kristian,

The error looks identical between 2.7.2 and the latest 2.7.3-SNAPSHOT versions. I attached a surefire-272.txt so you can see the stack. We do print a lot of output to stdout/stderr for many tests and if I make redirectTestOutputToFile false, the tests pass. We can also set our forkmode from once to always to get around this issue however a small test run that takes approx. 20 seconds to complete will take almost 2 minutes. We have over 16,000 tests so this is not an option for us.

Thanks,
Shell

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267259#action_267259 ] 

Kristian Rosenvold edited comment on SUREFIRE-704 at 5/17/11 12:07 PM:
-----------------------------------------------------------------------

I need the relevant parts of your pom.xml (surefire config). And yes, I see everything that goes on here ;)

      was (Author: krosenvold):
    I need the relevant pars of your pom.xml (surefire config)
  
> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Rosenvold closed SUREFIRE-704.
---------------------------------------

    Resolution: Fixed

You *must* be using an old version of 2.8.2-SNAPSHOT, since this message is physically removed from the code in the most recent versions. Run with mvn -U to make sure you get the latest deployed 2.8.2-SNAPSHOT and/or make sure your local repository manager actually checks for updates. I just redeployed to r.a.o  in case something went haywire last time I did so.

I'm closing this again, since the message in your log file is not possible to get from the latest version of surefire. I'll be releasing 2.9 as soon as I finish my own testing, which should be in a day or two.

And as usual, feel free to reopen ;)

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: surefire-272.txt, surefire-failure.log, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267467#action_267467 ] 

Kristian Rosenvold edited comment on SUREFIRE-704 at 5/19/11 1:08 PM:
----------------------------------------------------------------------

No it's actually all related to SUREFIRE-732. All of the reporting logic within surefire has just been way too complex. I did some analysis trying to understand "what is the correct functionality" *every single* version from 2.4.1 until today has had minor undocumented "adjustments"/bugs to the reporting logic that was not documented in release notes. And in the same manner I probably blew console output in xml logs for failing tests for 2.8.x (I will make a testcase for that now that I'm aware of it).

Hopefully 2.9+ (formerly 2.8.2) will stabilize this. In current trunk the reporting logic is much simpler than earlier, and most of the code now reads quite well. I'm just trying to make sure nothing is broken (read: testing extensively) before releasing 2.9. SUREFIRE-725 may end up waiting until 2.9.1.

      was (Author: krosenvold):
    No it's actually all related to SUREFIRE-732. All of the reporting logic within surefire has just been way too complex. I did some analysis trying to understand "what is the correct functionality" *every single* version from 2.4.1 until today has had minor undocumented "adjustments"/bugs to the reporting logic that was not documented in release notes. And in the same manner I probably blew console output in xml logs for failing tests for 2.7.x (I will make a testcase for that now that I'm aware of it).

Hopefully 2.9+ (formerly 2.8.2) will stabilize this. In current trunk the reporting logic is much simpler than earlier, and most of the code now reads quite well. I'm just trying to make sure nothing is broken (read: testing extensively) before releasing 2.9. SUREFIRE-725 may end up waiting until 2.9.1.
  
> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Rosenvold closed SUREFIRE-704.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.8.2
         Assignee: Kristian Rosenvold

As of SUREFIRE-732 with the followup in r1100808 this whole logic was simplified to the extent that this problem cannot happen any more. Revised 2.8.2-SNAPSHOT uploaded to r.a.o.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: surefire-272.txt, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Chad Wilson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267444#action_267444 ] 

Chad Wilson commented on SUREFIRE-704:
--------------------------------------

(Possibly not, re: 2nd question - as mvn -q test still seems to log to std out)

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258436#action_258436 ] 

Kristian Rosenvold commented on SUREFIRE-704:
---------------------------------------------

Unfortunately this issue will not be fixed before earliest 2.8.1, because the kind of code change required has not been possible until SUREFIRE-700 has been released.

Please note, Chad Wilson,  that adding the following to your plugin defintion will probably remove the randomness you are experiencing (and it's a good thing to do this immediately even with 2.7.2 if you're using fork timeout):

Plexus utils 2.0.7 will be appearing in maven central in a few hours. Adding this to surefire should solve this issue;
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
....
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>2.0.7</version>
</dependency>
</dependencies>
</plugin>

This *will* be fixed for 2.8

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>         Attachments: surefire-272.txt, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267259#action_267259 ] 

Kristian Rosenvold commented on SUREFIRE-704:
---------------------------------------------

I need the relevant pars of your pom.xml (surefire config)

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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] Reopened: (SUREFIRE-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S Daigle reopened SUREFIRE-704:
-------------------------------


We're still seeing these issues occasionally using 2.8.2-SNAPSHOT. They're much less frequent but they're still happening. I attached the surefire-failure.log file so you can see the stack trace.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: surefire-272.txt, surefire-failure.log, surefire.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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] Reopened: (SUREFIRE-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "S Daigle (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

S Daigle reopened SUREFIRE-704:
-------------------------------


Hi Kristian. I reopened because I didn't know if you would get my last update.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Chad Wilson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267495#action_267495 ] 

Chad Wilson commented on SUREFIRE-704:
--------------------------------------

Excellent - thanks Kristian. I'll add a dummy ticket for 2.8/2.8.1 fixed in 2.8.2 for this specific issue in case anyone else comes across it. I spent many hours scratching my head as to why our TeamCity build had stopped reporting these!

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.9
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267477#action_267477 ] 

Kristian Rosenvold commented on SUREFIRE-704:
---------------------------------------------

Added integration test of the console output/stderr into xml files in r1125083

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.9
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

-- 
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-704) maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice

Posted by "Kristian Rosenvold (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267467#action_267467 ] 

Kristian Rosenvold commented on SUREFIRE-704:
---------------------------------------------

No it's actually all related to SUREFIRE-732. All of the reporting logic within surefire has just been way too complex. I did some analysis trying to understand "what is the correct functionality" *every single* version from 2.4.1 until today has had minor undocumented "adjustments"/bugs to the reporting logic that was not documented in release notes. And in the same manner I probably blew console output in xml logs for failing tests for 2.7.x (I will make a testcase for that now that I'm aware of it).

Hopefully 2.9+ (formerly 2.8.2) will stabilize this. In current trunk the reporting logic is much simpler than earlier, and most of the code now reads quite well. I'm just trying to make sure nothing is broken (read: testing extensively) before releasing 2.9. SUREFIRE-725 may end up waiting until 2.9.1.

> maven surefire Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-704
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-704
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.x support
>    Affects Versions: 2.7.2
>         Environment: Windows/Linux/SunOS
>            Reporter: S Daigle
>            Assignee: Kristian Rosenvold
>             Fix For: 2.8.2
>
>         Attachments: sf-pom-config.txt, stack.txt, surefire-272.txt, surefire-failure.log, surefire.txt, test-out.txt
>
>
> We want to upgrade from our current 2.5 version of the maven-surefire-plugin to something newer but cannot get past the error below. We've tried versions 2.6, 2.7 up to and including 2.7.3-SNAPSHOT but they all fail.
> When setting forkmode to "once" and redirectTestOutputToFile to "true", we get the following error on multiple tests:
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.7.3-SNAPSHOT:test (default-test) on project api: Error while executing forked tests.; nested exception is java.lang.IllegalStateException: testSetStarting called twice -> [Help 1]
> Please see the attachment for full "mvn -e test" output.
> If we set the redirectTestOutputToFile to false, it works but we need this option set to true.
> Thanks

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