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

[GitHub] incubator-brooklyn pull request: Mark tests in NetworkingUtilsTest...

GitHub user aledsage opened a pull request:

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

    Mark tests in NetworkingUtilsTest as integration

    - For tests that open a port, mark them as integration because failing on apache jenkins.
    
    e.g. see failure in https://builds.apache.org/job/incubator-brooklyn-master-build/org.apache.brooklyn$brooklyn-utils-common/271/testReport/junit/brooklyn.util.net/NetworkingUtilsTest/testIsPortAvailableReportsFalseWhenPortIsInUse/
    
    ```
    Error Message
    
    could not get a port expected object to not be null
    Stacktrace
    
    java.lang.AssertionError: could not get a port expected object to not be null
    	at org.testng.Assert.fail(Assert.java:94)
    	at org.testng.Assert.assertNotNull(Assert.java:404)
    	at brooklyn.util.net.NetworkingUtilsTest.testIsPortAvailableReportsFalseWhenPortIsInUse(NetworkingUtilsTest.java:130)
    Standard Output
    
    2014-11-26 01:16:37,299 INFO  TESTNG INVOKING: "Surefire test" - brooklyn.util.net.NetworkingUtilsTest.testIsPortAvailableReportsFalseWhenPortIsInUse()
    2014-11-26 01:16:37,931 INFO  TESTNG FAILED: "Surefire test" - brooklyn.util.net.NetworkingUtilsTest.testIsPortAvailableReportsFalseWhenPortIsInUse() finished in 631 ms
    java.lang.AssertionError: could not get a port expected object to not be null
    	at brooklyn.util.net.NetworkingUtilsTest.testIsPortAvailableReportsFalseWhenPortIsInUse(NetworkingUtilsTest.java:130)
    ```

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

    $ git pull https://github.com/aledsage/incubator-brooklyn fix/mark-tests-as-integration

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

    https://github.com/apache/incubator-brooklyn/pull/360.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 #360
    
----
commit b2012d765d2da7b76e94633b9f532d526ca3fc79
Author: Aled Sage <al...@gmail.com>
Date:   2014-11-26T10:55:16Z

    Mark tests in NetworkingUtilsTest as integration
    
    - For tests that open a port, mark them as integration because 
      failing on apache jenkins.

----


---
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: Mark tests in NetworkingUtilsTest...

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

    https://github.com/apache/incubator-brooklyn/pull/360#discussion_r20931822
  
    --- Diff: utils/common/src/test/java/brooklyn/util/net/NetworkingUtilsTest.java ---
    @@ -107,8 +107,11 @@ public void testIsPortAvailableReportsTrueWhenPortIsFree() throws Exception {
             if (numFree<=5)
                 fail("This test requires that at least some ports near 58769+ not be in use.");
         }
    -    
    -    @Test
    +
    +    // Integration because fails in apache jenkins sometimes with "could not get a port".
    +    // Could all the ports between 58767 and 60000 be in use (!) or is there a restriction in
    --- End diff --
    
    Could be caused by parellel jenkins builds - i.e. master + PR builds. Isn't it better to first try with a random port returned by new ServerSocket(0) before going for this step?


---
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: Mark tests in NetworkingUtilsTest...

Posted by aledsage <gi...@git.apache.org>.
GitHub user aledsage reopened a pull request:

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

    Mark tests in NetworkingUtilsTest as integration

    - For tests that open a port, mark them as integration because failing on apache jenkins.
    
    e.g. see failure in https://builds.apache.org/job/incubator-brooklyn-master-build/org.apache.brooklyn$brooklyn-utils-common/271/testReport/junit/brooklyn.util.net/NetworkingUtilsTest/testIsPortAvailableReportsFalseWhenPortIsInUse/
    
    ```
    Error Message
    
    could not get a port expected object to not be null
    Stacktrace
    
    java.lang.AssertionError: could not get a port expected object to not be null
    	at org.testng.Assert.fail(Assert.java:94)
    	at org.testng.Assert.assertNotNull(Assert.java:404)
    	at brooklyn.util.net.NetworkingUtilsTest.testIsPortAvailableReportsFalseWhenPortIsInUse(NetworkingUtilsTest.java:130)
    Standard Output
    
    2014-11-26 01:16:37,299 INFO  TESTNG INVOKING: "Surefire test" - brooklyn.util.net.NetworkingUtilsTest.testIsPortAvailableReportsFalseWhenPortIsInUse()
    2014-11-26 01:16:37,931 INFO  TESTNG FAILED: "Surefire test" - brooklyn.util.net.NetworkingUtilsTest.testIsPortAvailableReportsFalseWhenPortIsInUse() finished in 631 ms
    java.lang.AssertionError: could not get a port expected object to not be null
    	at brooklyn.util.net.NetworkingUtilsTest.testIsPortAvailableReportsFalseWhenPortIsInUse(NetworkingUtilsTest.java:130)
    ```

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

    $ git pull https://github.com/aledsage/incubator-brooklyn fix/mark-tests-as-integration

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

    https://github.com/apache/incubator-brooklyn/pull/360.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 #360
    
----
commit b2012d765d2da7b76e94633b9f532d526ca3fc79
Author: Aled Sage <al...@gmail.com>
Date:   2014-11-26T10:55:16Z

    Mark tests in NetworkingUtilsTest as integration
    
    - For tests that open a port, mark them as integration because 
      failing on apache jenkins.

----


---
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: Mark tests in NetworkingUtilsTest...

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

    https://github.com/apache/incubator-brooklyn/pull/360#issuecomment-64595477
  
    Hm; not sure what happened there! I appear to have closed the PR, rather than it being merged!


---
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: Mark tests in NetworkingUtilsTest...

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

    https://github.com/apache/incubator-brooklyn/pull/360#issuecomment-64547266
  
    :+1: 
    OK 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: Mark tests in NetworkingUtilsTest...

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

    https://github.com/apache/incubator-brooklyn/pull/360#discussion_r20931954
  
    --- Diff: utils/common/src/test/java/brooklyn/util/net/NetworkingUtilsTest.java ---
    @@ -107,8 +107,11 @@ public void testIsPortAvailableReportsTrueWhenPortIsFree() throws Exception {
             if (numFree<=5)
                 fail("This test requires that at least some ports near 58769+ not be in use.");
         }
    -    
    -    @Test
    +
    +    // Integration because fails in apache jenkins sometimes with "could not get a port".
    +    // Could all the ports between 58767 and 60000 be in use (!) or is there a restriction in
    --- End diff --
    
    Either way, a unit test should not be using resources that are global and can affect, or be affecteded by, other processes. I think that it is correct that this should be an integration test.


---
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: Mark tests in NetworkingUtilsTest...

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

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


---
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: Mark tests in NetworkingUtilsTest...

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

    https://github.com/apache/incubator-brooklyn/pull/360#issuecomment-64548039
  
    Thanks @richardcloudsoft - merged.


---
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: Mark tests in NetworkingUtilsTest...

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

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


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