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

GrokWebSphereParserTest and BasicAsaParserTest are not 2017-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Major
    • Resolution: Done
    • 0.3.0
    • None
    • None
    • Travis operating on branch master

    Description

      In metron-platform/metron-parsers/src/test/java/org/apache/metron/parsers/websphere/GrokWebSphereParserTest.java eight of the test cases use a testString with log contents including a timestamp of "Apr 15" without year specified, then do an assertEquals() comparison against a hardwired epoch value that assumes a "Apr 15 2016" interpretation.

      Unfortunately, now that local time is 2017, it is interpreting these logs as "Apr 15 2017", even though that is in the future from now (Jan 3 as of this writing). This causes Travis failures without other cause.

      BTW, the assertEquals() calls incorrectly give arguments in order (actual, expected) instead of the correct order (expected, actual), so the error message was confusing. It said, e.g.,

      expected:<14[92278]448000> but was:<14[60742]448000>

      and yet the code says

      assertEquals(parsedJSON.get("timestamp") + "", "1460742448000");

      Whoever fixes this, please fix that too.

      The same problem occurs in one test case of metron-platform/metron-parsers/src/test/java/org/apache/metron/parsers/asa/BasicAsaParserTest.java::testIp6Addr() , where the assertTrue() timestamp comparison fails.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mattf Matthew Foley
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: