Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-6225

Fix random unit test failures in OptimalValuesTest

    Details

    • Type: Bug
    • Status: Done
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.0
    • Fix Version/s: 7.0.0
    • Component/s: backends
    • Labels:
      None
    • Story Points:
      0.5

      Description

      I just got a random test failure in OptimalValuesTest:

      [23/Apr/2019:10:22:22 +0200]  { 3:56 (  0s)}  {145c 1350m  5260i 0f}  {#rs  9}  : PasswordValidatorTestCase 
      
      
      
                       T E S T   S K I P P E D ! ! !
      
      Failed Test:  org.opends.server.backends.pluggable.OptimalValuesTest#threadCountIsEqualToZero
      Failure Cause:  java.lang.AssertionError: 
      Expecting:
       <4194304>
      to be equal to:
       <5242926>
      but was not.
          org.opends.server.backends.pluggable.OptimalValuesTest.threadCountIsEqualToZero(OptimalValuesTest.java:240)
      parameter[0]: 0
      parameter[1]: 4
      parameter[2]: 83886825
      parameter[3]: 4
      parameter[4]: 4
      parameter[5]: org.opends.server.backends.pluggable.OptimalValuesTest$$Lambda$1226/2041910335@33ce79fd
      
      
      -------------------------------------------------------------------------------
      
      
      
      
      
                       T E S T   S K I P P E D ! ! !
      
      Failed Test:  org.opends.server.backends.pluggable.OptimalValuesTest#threadCountIsEqualToZero
      Failure Cause:  java.lang.AssertionError: 
      Expecting:
       <4194304>
      to be equal to:
       <10485760>
      but was not.
          org.opends.server.backends.pluggable.OptimalValuesTest.threadCountIsEqualToZero(OptimalValuesTest.java:240)
      parameter[0]: 0
      parameter[1]: 2
      parameter[2]: 45035996273704960
      parameter[3]: 2147483647
      parameter[4]: 2147483647
      parameter[5]: org.opends.server.backends.pluggable.OptimalValuesTest$$Lambda$1226/2041910335@486265b7
      
      
      -------------------------------------------------------------------------------
      
      
      [23/Apr/2019:10:22:22 +0200]  { 3:56 (  0s)}  {146c 1355m  5273i 2f}  {#rs  9}  : OptimalValuesTest 
      

      It looks like the tests are still sensitive to whether the server is running or not.

      Suggested fix

      Remove sensitivity to server state, by pretending that the memory calculations are for off-heap usage. Also, decouple tests from other sources of non-deterministic behavior such as the default thread count which is also dependent on the server state.

        Attachments

          Activity

            People

            • Assignee:
              matthew Matthew Swift
              Reporter:
              matthew Matthew Swift
              Dev Assignee:
              Matthew Swift
              QA Assignee:
              carole forel
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: