You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by ahgittin <gi...@git.apache.org> on 2014/07/11 08:25:29 UTC

[GitHub] incubator-brooklyn pull request: make server pool test wait for me...

GitHub user ahgittin opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/64

    make server pool test wait for membership to catch up

    before making assertions, as resize happens in bg (whereas start is immediate)
    
    fixes http://brooklyn.builds.cloudsoftcorp.com/job/Brooklyn-Master-Build/io.brooklyn$brooklyn-software-base/418/testReport/junit/brooklyn.entity.pool/ServerPoolTest/testResizingPoolUp/
    
    (confirmed by inserting a sleep in `ServerPoolImpl.serverAdded` which triggers the failure before this fix is applied)
    
    maybe we want instead to change `resize` to wait for membership to catch up?  i wasn't sure...

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ahgittin/incubator-brooklyn fix/server-pool-test-not-immediate

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/64.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #64
    
----
commit ce8d19c9348797724ab9d9915b3a8627379a6bc6
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date:   2014-07-11T06:23:06Z

    make server pool test wait for membership to catch up before making assertions, as resize happens in bg (whereas start is immediate)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: make server pool test wait for me...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/64#discussion_r14886549
  
    --- Diff: software/base/src/test/java/brooklyn/entity/pool/AbstractServerPoolTest.java ---
    @@ -112,6 +113,10 @@ protected void assertAvailableCountEquals(ServerPool pool, Integer count) {
             assertEquals(pool.getAttribute(ServerPool.AVAILABLE_COUNT), count);
         }
     
    +    protected void assertAvailableCountEventuallyEquals(int count) {
    +        EntityTestUtils.assertAttributeEqualsEventually(pool, ServerPool.AVAILABLE_COUNT, count);
    --- End diff --
    
    Would be nice to have consistency for our suffix: "equalsEventually" or "eventuallyEquals". I'll e-mail dev@brooklyn at some point to suggest a consistent suffix.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: make server pool test wait for me...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-brooklyn/pull/64


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: make server pool test wait for me...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/64#discussion_r14886339
  
    --- Diff: software/base/src/test/java/brooklyn/entity/pool/ServerPoolTest.java ---
    @@ -87,12 +86,20 @@ public void testResizingPoolUp() {
             assertNoMachinesAvailableForApp(app2);
     
             pool.resizeByDelta(1);
    +        
    +        assertAvailableCountEventuallyEquals(1);
     
             assertEquals((int) pool.getCurrentSize(), getInitialPoolSize() + 1);
             app2.start(ImmutableList.of(pool.getDynamicLocation()));
             assertTrue(app2.getAttribute(Attributes.SERVICE_UP));
         }
     
    +//    @Test(invocationCount=100, groups="Integration")
    --- End diff --
    
    Delete this commented out code, or add it to an "Acceptance" group instead.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: make server pool test wait for me...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/64#issuecomment-48920190
  
    Looks good. Just one comment to be addressed about commented out code, and then good to merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: make server pool test wait for me...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/64#issuecomment-49124535
  
    thanks, addressed comment, and merging


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: make server pool test wait for me...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/64#discussion_r14981657
  
    --- Diff: software/base/src/test/java/brooklyn/entity/pool/ServerPoolTest.java ---
    @@ -87,12 +86,20 @@ public void testResizingPoolUp() {
             assertNoMachinesAvailableForApp(app2);
     
             pool.resizeByDelta(1);
    +        
    +        assertAvailableCountEventuallyEquals(1);
     
             assertEquals((int) pool.getCurrentSize(), getInitialPoolSize() + 1);
             app2.start(ImmutableList.of(pool.getDynamicLocation()));
             assertTrue(app2.getAttribute(Attributes.SERVICE_UP));
         }
     
    +//    @Test(invocationCount=100, groups="Integration")
    --- End diff --
    
    done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: make server pool test wait for me...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/64#discussion_r14981558
  
    --- Diff: software/base/src/test/java/brooklyn/entity/pool/AbstractServerPoolTest.java ---
    @@ -112,6 +113,10 @@ protected void assertAvailableCountEquals(ServerPool pool, Integer count) {
             assertEquals(pool.getAttribute(ServerPool.AVAILABLE_COUNT), count);
         }
     
    +    protected void assertAvailableCountEventuallyEquals(int count) {
    +        EntityTestUtils.assertAttributeEqualsEventually(pool, ServerPool.AVAILABLE_COUNT, count);
    --- End diff --
    
    feels like a bike-shed email, better I think just to PR a refactoring where the common methods do things in a clear and consistent way.  perhaps introduce some assertj tests first and see as that might steer us towards a good idiom.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---