Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25916

Make the functional tests fail when the server logs an abusive modification of a cached document

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 18.10.0
    • None
    • Unknown

    Description

      When code modifies a document instance that comes from the document cache, XWikiDocument#setMetaDataDirty logs the warning "Abusive modification of the cached document" with a stack trace. Such a modification is a bug: the change becomes visible to every other request using the cached document, even if it is never saved. Each occurrence found so far has been reported and fixed as its own issue (e.g. XWIKI-23108, XWIKI-24555, XWIKI-25915), but only when someone noticed the warning by chance, since the console validation of the functional tests (LogCaptureValidator) only fails on errors, on Deprecated usage of and on a Tomcat cache warning.

      The idea is to also fail the functional tests when the server logs "Abusive modification of the cached document", so that new occurrences are caught by the CI when they are introduced.

      The console logs of recent builds of the master branch (main build and environment tests) show two occurrences, which need to be fixed first:

      • VersionIT#getRevisionsWithCriteria, whose script changes the reference of the cached document instance (test only).
      • ExtensionIT (nested NestedExtensionIT#testResetDocument), which is XWIKI-25915.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: