This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-03546b73-ce4f-4246-be1e-14695334daf1 XWIKI-25061 Open

SyntaxHighlightingIT#highlightContent is flickering

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-3832de79-0e93-4b39-ae33-75c4ef193eaa Manuel Leduc created this issue on 30/Sep/26 15:48
 
Summary: SyntaxHighlightingIT#highlightContent is flickering
Issue Type: cid:jira-generated-image-avatar-03546b73-ce4f-4246-be1e-14695334daf1 Bug
Affects Versions: 18.4.5
Assignee: Unassigned
Components: Development Issues only
Created: 30/Sep/26 15:48
Labels: flickering
Priority: cid:jira-generated-image-static-major-58dc94b2-4ffd-4a68-8ae3-356567355632 Major
Reporter: Manuel Leduc
Description:

The functional test org.xwiki.test.ui.docker.AllIT$NestedSyntaxHighlightingIT#highlightContent fails intermittently on ci.xwiki.org.

Occurrence

  • Seen in https://ci.xwiki.org/job/XWiki/job/xwiki-platform/job/stable-18.4.x/217/testReport/ (commit 89eec5c383f), environment: default configuration of the main job (Jetty standalone, HSQLDB, Firefox).
  • History: 1 failure in 20 builds of the stable-18.4.x main job; passes on master, stable-18.8.x and stable-17.10.x.
  • Local verification on 89eec5c383f: the whole module passed with the CI Maven options, and the test passed 20/20 when repeated alone.

Error

org.openqa.selenium.StaleElementReferenceException: The element with the reference c05dbaa3-40f9-4054-a91f-3114388bef4f is stale; either its node document is not the active document, or it is no longer connected to the DOM
	at org.xwiki.test.ui.docker.SyntaxHighlightingIT.getLines(SyntaxHighlightingIT.java:99)
	at org.xwiki.test.ui.docker.SyntaxHighlightingIT.highlightContent(SyntaxHighlightingIT.java:88)

Analysis

SyntaxHighlightingIT#getLines finds the pre.CodeMirror-line elements without waiting and then calls getText() on each. CodeMirror replaces those nodes on every re-render (after the input is processed, after the highlighting pass, on refresh), so when a re-render happens between the lookup and the read the element is stale. The assertion right after typing (assertEquals(List.of(CONTENT, ADDED_CONTENT), getLines(driver))) also does not wait for the expected state.

Possible fix

Wait until getLines() returns the expected lines, retrying on StaleElementReferenceException (same for getMacroMarkers).

 
 

1 update

 
cid:jira-generated-image-avatar-3832de79-0e93-4b39-ae33-75c4ef193eaa Changes by Manuel Leduc on 30/Sep/26 15:48
 
Flickering Test: org.xwiki.test.ui.docker.AllIT$NestedSyntaxHighlightingIT#highlightContent