Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-4008

Restore TestCachingFDS.testDeleteRecord() to fix it with disabling AsyncUpload in unit tests

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.13.2
    • 2.13.4, 2.14, 2.12.10, 2.10.9
    • None
    • None

    Description

      The test used to fail occasionally before the test method was commented out by JCR-4006:

      junit.framework.AssertionFailedError: rec2 should be null
      	at junit.framework.Assert.fail(Assert.java:50)
      	at junit.framework.Assert.assertTrue(Assert.java:20)
      	at junit.framework.Assert.assertNull(Assert.java:237)
      	at org.apache.jackrabbit.core.data.TestCaseBase.doDeleteRecordTest(TestCaseBase.java:327)
      	at org.apache.jackrabbit.core.data.TestCaseBase.testDeleteRecord(TestCaseBase.java:192)
      

      The main reason of this error is because the underlying backend uses asynchronous writing threads by default, which is not working well when extending org.apache.jackrabbit.core.data.TestCaseBase as mentioned in JCR-4005.
      So, it seems better to fix it again like the following like how JCR-4005 was fixed:

      • Restore the commented out block (TestCachingFDS.testDeleteRecord()).
      • Provide an option to disable asynchronous writing in all the related backend implementations. e.g., disable it if asyncWritePoolSize is zero or smaller.
      • In unit tests, simply disable async writing.

      Attachments

        Issue Links

          Activity

            People

              amitjain Amit Jain
              woon_san Woonsan Ko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: