Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1241

md5Hash results with line endings \r\n on MaterializedLambda tests on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 7.8.0.GA
    • 7.7.0.GA
    • None
    • None
    • 2020 Week 07-09 (from Feb 10)

    Description

      Several testes are failing on org.drools.modelcompiler.util.lambdareplace package due the md5Hash function called on className method on classes which extend MatarializedLamda class because Windows consider \r\n as line endings. So the md5Hash results different hashcodes than the expected on assertions.

      If there is any customer's use case related to this usage, I believe that the software should deal with the compatibility between different operating systems.
      If the hash isn't stored and computed only on runtime, the test approch might be changed to compute the hash on the same way it is in production instead of loading it from stored files. Or a different solution might stood up.

      Failing tests:

      • MaterializedLambdaPredicateTest.createClassWithOneParameter
      • MaterializedLambdaPredicateTest.createClassWithTwoParameters
      • MaterializedLambdaExtractorTest.createExtractor
      • MaterializedLambdaConsequenceTest.createConsequence
      • ExecModelLambdaPostProcessorTest.convertFlowLambdaDoNotConvertConsequenceWhenDrools
      • ExecModelLambdaPostProcessorTest.convertPatternLambda

      If the \r is removed when calling md5Hash function, all testes pass. See the attachment [materialized_lambda_hash.patch].

      Stacktrace here: https://gist.github.com/hellowdan/fc1ceb5b640239a4f284c980540eeaca
      or see the attached file [materialized_lambda_jenkins_output.pdf] for the full output.

      Attachments

        Issue Links

          Activity

            People

              lmolteni@redhat.com Luca Molteni
              drosabrno Daniel Rosa
              Daniel Rosa Daniel Rosa
              Daniel Rosa Daniel Rosa
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: