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

Manually setting service.isUp is overwritten by enricher (causing non-deterministic test failures)

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

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.9.0
    • 0.10.0
    • None

    Description

      If one creates an entity and explicitly sets its service.isUp to true, then the default enrichers can override this value to remove it. This is because it is executing concurrently, and if service-up-indicators is null then it removes the service.isUp sensor value!

      A similar thing happens for the service.state sensor.

      This is non-deterministic, but can be demonstrate with this simple test:

      for (int i = 0; i < 100; i++) {
          TestEntity entity = app.addChild(EntitySpec.create(TestEntity.class));
          entity.sensors().set(TestEntity.SERVICE_UP, true);
          entity.sensors().set(TestEntity.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
          Thread.sleep(10);
          assertEquals(entity.sensors().get(TestEntity.SERVICE_UP), Boolean.TRUE);
          assertEquals(entity.sensors().get(TestEntity.SERVICE_STATE_ACTUAL), Lifecycle.RUNNING);
      }
      

      Most entities don't explicitly set the service.isUp, so it has not been a problem in production systems. However, it does impact tests - it is the likely cause of many non-deterministic test failures.

      Attachments

        Activity

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

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment