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

MacroIT is flickering on Firefox and its failed edit-mode cleanup fails the rest of AllIT

    XMLWordPrintable

Details

    • Unknown
    • org.xwiki.ckeditor.test.ui.AllIT$NestedMacroIT#children

    Description

      Symptom

      org.xwiki.ckeditor.test.ui.MacroIT sometimes times out on Firefox in CKEditorToolBar.toggleSourceMode(), which waits 10s for an element to disappear when switching to Source to check the result:

      org.openqa.selenium.TimeoutException: Expected condition failed: waiting for org.xwiki.test.ui.XWikiWebDriver$$Lambda$1872/... (tried for 10 seconds with 500 milliseconds interval)
      	at org.xwiki.test.ui.XWikiWebDriver.waitUntilElementDisappears(XWikiWebDriver.java:390)
      	at org.xwiki.ckeditor.test.po.CKEditorToolBar.toggleSourceMode(CKEditorToolBar.java:299)
      	at org.xwiki.ckeditor.test.ui.AbstractCKEditorIT.assertSourceEquals(AbstractCKEditorIT.java:92)
      	at org.xwiki.ckeditor.test.ui.MacroIT.children(MacroIT.java:110)
      

      The failed test leaves CKEditor with unsaved changes, so MacroIT#afterEach cannot leave the edit mode (TestUtils.maybeLeaveEditMode is blocked by the beforeunload dialog). Since AllIT runs all its @Nested ITs in a single browser session, every following test then fails in its setup with:

      org.openqa.selenium.UnhandledAlertException: Unexpected beforeunload dialog detected. Performed handler "ignore": This page is asking you to confirm that you want to leave — information you've entered may not be saved.
      	at org.xwiki.test.docker.internal.junit5.XWikiDockerExtension.beforeEach(XWikiDockerExtension.java:198)
      

      So one flicker turns into ~17 failures: the remaining MacroIT methods, TableIT#backspaceAfterInsertRow, and class-level failures of NestedSaveIT, NestedImageIT, NestedTextAreaIT, NestedLinkIT, NestedQuickActionsIT, NestedUndoRedoIT, NestedLocalizationIT, NestedFilterIT and NestedMacroIT.

      Occurrences (stable-17.10.x, Oracle 19.3.0-se2 / Jetty 12-jdk25 / Filesystem / Firefox 158)

      The other environments (Chrome) did not fail.

      Local reproduction

      MacroIT run 3 times locally on commit 87df7079518 with the same configuration (-Dxwiki.test.ui.database=oracle -Dxwiki.test.ui.databaseTag=19.3.0-se2 -Dxwiki.test.ui.servletEngine=jetty -Dxwiki.test.ui.servletEngineTag=12-jdk25 -Dxwiki.test.ui.browser=firefox -Dxwiki.test.ui.blobStore=filesystem, Firefox 158.0): 21/21 executions passed. So it really is intermittent, not a breakage.

      Two things to fix

      1. the toggleSourceMode timeout itself on Firefox;
      2. the missing recovery in the cleanup: a failure that leaves unsaved content should not take down the rest of AllIT (see XWIKI-24806 for the same problem in TextAreaImageUploadIT).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              surli Simon Urli
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: