You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2012/09/08 15:52:07 UTC

[jira] [Created] (SLING-2595) Tests should not check if the server is ready

Carsten Ziegeler created SLING-2595:
---------------------------------------

             Summary: Tests should not check if the server is ready
                 Key: SLING-2595
                 URL: https://issues.apache.org/jira/browse/SLING-2595
             Project: Sling
          Issue Type: Bug
          Components: Testing
    Affects Versions: Commons Testing 2.0.10
            Reporter: Carsten Ziegeler
             Fix For: Commons Testing 2.0.12


Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.

I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.

The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2595) Tests should not check if the server is ready

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451826#comment-13451826 ] 

Bertrand Delacretaz commented on SLING-2595:
--------------------------------------------

The tests in question test a Sling instance remotely via http, so they won't see FRAMEWORK_STARTED or similar events.

Writing to root might not be the best way to find out whether the server is ready, but whatever changes to that mechanism should not break the integration tests that run at launchpad/testing. You cannot "just assume that the server is ready" in such tests, depending on the environment (think overloaded Jenkins build server) the instance under test might need a while to be up.
                
> Tests should not check if the server is ready
> ---------------------------------------------
>
>                 Key: SLING-2595
>                 URL: https://issues.apache.org/jira/browse/SLING-2595
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Commons Testing 2.0.10
>            Reporter: Carsten Ziegeler
>             Fix For: Commons Testing 2.0.12
>
>
> Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.
> I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.
> The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2595) Make server ready check for tests optional

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451868#comment-13451868 ] 

Felix Meschberger commented on SLING-2595:
------------------------------------------

I think it is not the task of the tests to check for system readyness: They should assume the system is ready.

Therefore:
  * I think the workaround is not needed and the whole check block should be removed
  * The standard test setup in the launchpad should ensure Sling is up before starting the tests

If the system happens to not be ready when the tests start, they will certainly fail and thus we are on the "safe" side of not getting false positives.
                
> Make server ready check for tests optional
> ------------------------------------------
>
>                 Key: SLING-2595
>                 URL: https://issues.apache.org/jira/browse/SLING-2595
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Commons Testing 2.0.10
>            Reporter: Carsten Ziegeler
>             Fix For: Commons Testing 2.0.12
>
>
> Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.
> I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.
> The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2595) Make server ready check for tests optional

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451901#comment-13451901 ] 

Bertrand Delacretaz commented on SLING-2595:
--------------------------------------------

@Carsten, patch looks good to me, thanks!
@Felix we could move the tests to the code that starts the server - I don't see a need right now but that might be an option.
                
> Make server ready check for tests optional
> ------------------------------------------
>
>                 Key: SLING-2595
>                 URL: https://issues.apache.org/jira/browse/SLING-2595
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Commons Testing 2.0.10
>            Reporter: Carsten Ziegeler
>             Fix For: Commons Testing 2.0.12
>
>
> Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.
> I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.
> The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2595) Tests should not check if the server is ready

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451480#comment-13451480 ] 

Carsten Ziegeler commented on SLING-2595:
-----------------------------------------

I've committed a potential solution by just adding a new system property.

(Of course the check is only done once, however the result is cached and used for every test)
                
> Tests should not check if the server is ready
> ---------------------------------------------
>
>                 Key: SLING-2595
>                 URL: https://issues.apache.org/jira/browse/SLING-2595
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Commons Testing 2.0.10
>            Reporter: Carsten Ziegeler
>             Fix For: Commons Testing 2.0.12
>
>
> Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.
> I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.
> The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2595) Tests should not check if the server is ready

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451822#comment-13451822 ] 

Felix Meschberger commented on SLING-2595:
------------------------------------------

IIRC that startup check was introduced to prevent starting tests before Sling was ready to process requests. Maybe it was even at a time where declarative services processing was asynchronous and thus the FRAMEWORK_STARTED event was fired before the system was actually up and running.

Nowadays, the FRAMEWORK_STARTED event is only fired when the initial start level is reached and DS has done all its processing.

Hence: Do we still need that check at all ?
                
> Tests should not check if the server is ready
> ---------------------------------------------
>
>                 Key: SLING-2595
>                 URL: https://issues.apache.org/jira/browse/SLING-2595
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Commons Testing 2.0.10
>            Reporter: Carsten Ziegeler
>             Fix For: Commons Testing 2.0.12
>
>
> Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.
> I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.
> The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SLING-2595) Tests should not check if the server is ready

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451860#comment-13451860 ] 

Carsten Ziegeler commented on SLING-2595:
-----------------------------------------

Please have a look at my committed patch, it just adds a new system property which by default is not set. If it is set, this test is skipped.
It solves my use cases and leaves by default everything as is

I would be happy to replace the check with something else and more rely on a push than a pull, but that would be a different issue then :)
                
> Tests should not check if the server is ready
> ---------------------------------------------
>
>                 Key: SLING-2595
>                 URL: https://issues.apache.org/jira/browse/SLING-2595
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Commons Testing 2.0.10
>            Reporter: Carsten Ziegeler
>             Fix For: Commons Testing 2.0.12
>
>
> Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.
> I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.
> The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (SLING-2595) Make server ready check for tests optional

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-2595.
-------------------------------------

    Resolution: Fixed
      Assignee: Carsten Ziegeler

Thanks, so I'll close this :)
                
> Make server ready check for tests optional
> ------------------------------------------
>
>                 Key: SLING-2595
>                 URL: https://issues.apache.org/jira/browse/SLING-2595
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Commons Testing 2.0.10
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Commons Testing 2.0.12
>
>
> Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.
> I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.
> The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SLING-2595) Make server ready check for tests optional

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated SLING-2595:
------------------------------------

    Summary: Make server ready check for tests optional  (was: Tests should not check if the server is ready)
    
> Make server ready check for tests optional
> ------------------------------------------
>
>                 Key: SLING-2595
>                 URL: https://issues.apache.org/jira/browse/SLING-2595
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Commons Testing 2.0.10
>            Reporter: Carsten Ziegeler
>             Fix For: Commons Testing 2.0.12
>
>
> Right now if you extend the HttpTestBase each and every test checks whether the server is up and running. This is done by writing to the root of the repository. Once some security is in place and writing to root is not possible, all tests fail.
> I think it shouldn't be the task of the tests to check if the server is running, they should simply assume the server is available.
> The simplest solution for now would be to make this check configurable by a system property

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira