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

SearchSuggestIT can fail with a timeout waiting for the quick search suggestions to load

    XMLWordPrintable

Details

    • Unknown
    • org.xwiki.search.test.ui.AllIT$NestedSearchSuggestIT#searchExclusions

    Description

      Symptom

      SearchSuggestIT intermittently fails with a TimeoutException (10s) in QuickSearchElement.search() (line 46), while waiting for .searchSuggest li.showAllResults.loading to become visible. The CI screenshot shows the suggestion panel fully loaded with the expected results: the suggestions did load, but the loading class was never put on the "Go to search page" item.

      Affected test methods:

      • org.xwiki.search.test.ui.AllIT$NestedSearchSuggestIT#searchExclusions
      • org.xwiki.search.test.ui.AllIT$NestedSearchSuggestIT#verifySearchSuggestTitles (first quick search of the test)

      Evidence

      About 3 failures out of ~1240 executions since 2026-09-07, on master and stable-18.8.x. The CI video shows "foobar" typed, then the panel with only "Go to search page..." and no spinner, then the results.

      Root cause

      suggest.js#prepareContainer adds the loading class to the loader node (the showAllResults item) only when the source result containers already exist. On the first getSuggestions call of a page, the containers are created and only they get loading. With one onKeyUp per typed character, the 2nd+ keystroke marks the loader node, which is why the page object wait usually works.

      Since XWIKI-22936 (18.8.0-rc-1), the suggest widget is created asynchronously on the first focus/mouseenter of the search field, after fetching the sources and translations. When that fetch completes after sendKeys has typed the whole text, createSuggest calls getSuggestions only once, so the loader node never gets loading and the wait times out although the results are displayed.

      The fix is in the QuickSearchElement page object: wait until at least one source result container exists and none of them is loading, instead of waiting for the loading class on the "Go to search page" item.

      Only versions containing XWIKI-22936 (18.8.0-rc-1 and later) are affected; the LTS branches are not.

      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: