Uploaded image for project: 'Metron (Retired)'
  1. Metron (Retired)
  2. METRON-2168

Elasticsearch Updates Not Tested in Integration Test

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Major
    • Resolution: Done
    • None
    • Next + 1
    • None

    Description

      The `ElasticsearchUpdateIntegrationTest` is not testing that the `ElasticsearchDao` can update and retrieve values in a manner similar to what would occur in production.

      What?

      Within the Elasticsearch index, the test fails to define the 'guid' field to be of type 'keyword', instead the type is defaulted to 'text'.  In a production setting this mistake would prevent any documents from being found by guid.  Unfortunately, the test passes despite this. The test needs to match the behavior of what a user would experience in production.

      Why? 

      These problems arise because of the way the test is setup.  Instead of directly testing an `ElasticsearchDao` as you might expect this test runs against a `MultiIndexDao` initialized with both an `ElasticseachDao` and an `HBaseDao`. On retrievals the `MultIndexDao` will return the document from whichever index responds first.

      With the current test setup, the underlying `ElasticsearchDao` will never retrieve the document that the test case is expected.  In all cases where the test passes, the document is actually being returned from the `HBaseDao` which is actually just interacting with a mock backend.  The test needs to actually test that we can update and retrieve documents from Elasticsearch.

      Proof?

       If you alter the test to run against just an `ElasticsearchDao` the test will fail as follows in the attached log file.

       

      Attachments

        1. test-failure.log
          61 kB
          Nick Allen

        Issue Links

          Activity

            People

              nickwallen Nick Allen
              nickwallen Nick Allen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m