Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-28974

Proper cleanup for tests leaving documents under retention / legal hold

    XMLWordPrintable

    Details

    • Tags:
    • Team:
      FG
    • Sprint:
      nxFG 11.1.13
    • Story Points:
      1

      Description

      When a unit test creates a document under retention / legal hold and leaves its cleanup to the CoreFeature cleanup mechanism, we should make sure this is done correctly in all cases without leaving messages in the logs.

      For example we still have:

      [INFO] Running org.nuxeo.ecm.core.TestBlobDispatcherRecord
      2020-04-22 11:07:10,924 [main] ERROR [TransactionalBlobStore] Missing blob from transient blob store: 8002698676588878512, failed to commit creation of file: 11693be6-e209-4d92-9f0e-9b9237587023
      2020-04-22 11:07:10,927 [Nuxeo-Work-default-1:8814756411723.668104545] ERROR [ManagedBlob] Failed to access file: records1:11693be6-e209-4d92-9f0e-9b9237587023
      2020-04-22 11:07:10,932 [pool-2-thread-13] ERROR [CoreFeature] Unable to reset repository
      org.nuxeo.ecm.core.api.DocumentSecurityException: Cannot remove main blob from document 11693be6-e209-4d92-9f0e-9b9237587023, it is under retention / hold
           at org.nuxeo.ecm.core.blob.DefaultBlobDispatcher.checkBlobCanBeDeleted(DefaultBlobDispatcher.java:436) ~[classes/:?]
           at org.nuxeo.ecm.core.blob.DefaultBlobDispatcher.deleteBlobIfRecord(DefaultBlobDispatcher.java:428) ~[classes/:?]
           at org.nuxeo.ecm.core.blob.DefaultBlobDispatcher.notifyBeforeRemove(DefaultBlobDispatcher.java:422) ~[classes/:?]
           at org.nuxeo.ecm.core.blob.DocumentBlobManagerComponent.notifyBeforeRemove(DocumentBlobManagerComponent.java:270) ~[classes/:?]
           at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.notifyDocumentBlobManagerBeforeRemove(SQLSession.java:630) ~[classes/:?]
           at org.nuxeo.ecm.core.storage.sql.SessionImpl.removeNode(SessionImpl.java:1012) ~[classes/:?]
           at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.removeNode(ConnectionImpl.java:257) ~[classes/:?]
           at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.remove(SQLSession.java:625) ~[classes/:?]
           at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.remove(SQLDocumentLive.java:165) ~[classes/:?]
           at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.remove(SQLDocumentLive.java:171) ~[classes/:?]
           at org.nuxeo.ecm.core.api.AbstractSession.removeNotifyOneDoc(AbstractSession.java:1459) ~[classes/:?]
           at org.nuxeo.ecm.core.api.AbstractSession.removeChildren(AbstractSession.java:1366) ~[classes/:?]
           at org.nuxeo.ecm.core.test.CoreFeature.lambda$cleanupSession$1(CoreFeature.java:251) ~[classes/:?]
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m