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

Docker functional tests: a second top-level @UITest class in the same test JVM provisions and runs against the previous class's XWiki instance

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 18.10.0-rc-1
    • 18.3.0-rc-1
    • Test Framework
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Since XWIKI-17828, XWikiDockerExtension stores the XWikiExecutor list, the current executor index, the ServletContainerExecutor list and the PersistentTestContext in the JUnit root store (DockerTestUtils#getStore), and never resets them after a top-level @UITest class has finished. A second top-level class run in the same JVM appends its executor but makes index 0, the previous class's executor, current again. Its extensions are therefore installed on the previous instance, which is still running because Docker servlet containers are only stopped when the JVM exits, and the install fails with:

      InstallException: Extension [org.xwiki.platform:xwiki-platform-index-tree-macro/18.10.0-SNAPSHOT] is already installed on namespace [wiki:xwiki]
      

      With Jetty standalone it only works by accident, since both instances use port 8080.

      In addition, when WCAG validation is enabled, the second class's afterAll fails with a FileAlreadyExistsException on target/<config>/wcag-reports, because the report directory is per configuration, not per test class.

      Seen with SkinVisualIT in xwiki-platform-flamingo-skin-test-docker, on all the environment test configurations (MySQL and PostgreSQL on Tomcat 11, MariaDB and Oracle on Jetty 12), e.g. https://ci.xwiki.org/job/XWiki%20Environment%20Tests/job/xwiki-platform/job/master/1414/

      Note that this issue is about the test framework. For SkinVisualIT itself, the better fix is XWIKI-25589: once the icon theme can be switched at runtime without a browser hard refresh, SkinVisualIT can become a nested test of AllIT, like the other tests of the module.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: