Uploaded image for project: 'Brooklyn'
  1. Brooklyn
  2. BROOKLYN-561

EnrichersSlightlySimplerYamlTest.testWithAppEnricher fails non-deterministically

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.0.0
    • None

    Description

      The test EnrichersSlightlySimplerYamlTest.testWithAppEnricher fails non-deterministically in 1.0.0-SNAPSHOT:

      2017-11-10 20:17:47,520 INFO  TESTNG FAILED: "Surefire test" - org.apache.brooklyn.qa.camp.EnrichersSlightlySimplerYamlTest.testWithAppEnricher() finished in 1582 ms
      java.lang.AssertionError: Wrong URI:  expected [true] but found [false]
              at org.apache.brooklyn.qa.camp.EnrichersSlightlySimplerYamlTest.testWithAppEnricher(EnrichersSlightlySimplerYamlTest.java:90)
      

      This is because the cluster and app's URIs are initially set to an empty MAIN_URI! There is a joiner that takes the urls.list and generates an empty string. This is coerced to a URI by calling URI.create(""), which surprisingly gives you a URI with a null scheme, hostname, etc. You can make the fail consistently by adding the assertions below before setting the IPs on the members of the cluster:

      EntityAsserts.assertAttributeEqualsContinually(cluster, Attributes.MAIN_URI, null);
      EntityAsserts.assertAttributeEqualsContinually(app, Attributes.MAIN_URI, null);
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            aled.sage Aled Sage
            aled.sage Aled Sage
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment