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

TextAreaImageUploadIT is flickering and its missing edit-mode cleanup fails the rest of AllIT

    XMLWordPrintable

Details

    • Integration
    • Unknown
    • N/A
    • N/A
    • org.xwiki.edit.test.ui.AllIT$NestedTextAreaImageUploadIT#uploadImageInObjectProperty(TestUtils, TestReference)

    Description

      Symptom

      org.xwiki.edit.test.ui.AllIT runs its @Nested ITs in a single shared browser session, with NestedTextAreaImageUploadIT first. When one of the TextAreaImageUploadIT tests fails while CKEditor is loaded with unsaved changes, the page is left with an armed beforeunload handler. The next navigation then fails 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.
      

      Chrome reports the same thing as InvalidArgumentException: invalid argument: Unexpected dialog type beforeunload.

      Because the browser session is shared between all the nested ITs, every remaining nested IT then dies in its setup, so a single flickering test turns into six failures.

      Two occurrences on 2026-09-03 (stable-18.4.x, commit fb8021ba)

      • https://community.develocity.cloud/s/7uulfbxjm6s3i - ci.xwiki.org XWiki/xwiki-platform/stable-18.4.x #176, Firefox
        • uploadImageInObjectProperty: the real failure, a 10s TimeoutException in TextAreaImageUploadIT.uploadImage() on ckeditor.getToolBar().insertImage() - the image dialog never opened
        • uploadImageInEditableProperty: hung 422 seconds on a single driver.get() blocked by the dialog
        • NestedInplaceEditWithAnnotationsIT, NestedInplaceTranslateIT and NestedInplaceEditIT: all failed in under one second, in setup
      • https://community.develocity.cloud/s/cerfmzcv5hzvm - XWiki Environment Tests #113, Chrome 151
        • uploadImageInComment: the same 10s insertImage() timeout
        • then uploadImageInAnnotation and the same three nested ITs

      In both builds InplaceTranslateIT's @AfterAll could not run either, so the wiki was left with multilingual=true for the rest of AllIT.

      Two separate problems

      1. Missing cleanup - the cascade. TextAreaImageUploadIT has no @AfterEach leaving edit mode, unlike InplaceTranslateIT which calls TestUtils#maybeLeaveEditMode(). Adding one contains the damage to the single failing test instead of taking down the whole suite.
      2. The underlying flicker. ckeditor.getToolBar().insertImage() sometimes does not open the image dialog within the 10s wait. It happens on master too:

      Those master runs did not cascade only by luck - the nested-class order and the missing cleanup are identical there.

      The VNC recording archived by CI for the failing test (...-uploadImageInObjectProperty.flv) is the way in to diagnose why the toolbar click does not open the dialog.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: