There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-b5517069-f6ca-4294-bc2d-e0f89db1eef0 XWIKI-23873 Open

PDFExportIT#largeExcelImport is flickering

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-e15ae0ed-35e4-4047-8384-8b197a8e9d8a Marius Dumitru Florea on 05/Feb/26 16:06
 

The flickering is caused by hyphenation. Based on https://issues.chromium.org/issues/40257759

Note that in the headful Chrome, the hyphenation dictionaries are downloaded by using the component updater, so for a new data dir, you'll need to wait for 6 minutes.

I deduce that since hyphenation depends on the language, Chrome needs to use a dictionary in order to know how to hyphenate a given language. It seems that these hyphenation dictionaries are not bundled by default. Instead, they are downloaded (and updated?) after installation. Moreover, they are saved per user profile, in the user directory. So when you create a new profile, the hyphenation dictionaries have to be redownloaded.

PDF export tests are using a headless Chrome running inside a Docker container. A new user profile is created automatically when the Docker container is created and Chrome is opened, before the tests are executed. This means that depending on how long it takes:

  • to download the hyphenation dictionaries
  • to run the tests before largeExcelImport

we may have the language (EN) dependent hyphenation ready when largeExcelImport starts or not.

Based on https://issues.chromium.org/issues/353304848

Hyphenation dictionaries machinery relies on component installer to initialize hyphenation dictionaries directory. However, it is common for automation frameworks to disable component installer with --disable-component-update switch in which case hyphenation dictionaries directory is never initialized and hyphenation dictionaries bundled with Chrome for Testing are not used.

This CL changes Chrome for Testing hyphenation dictionaries directory provider callback so that if component installer is disabled, the well know hyphenation dictionaries directory is provided.

It seems that we can disable the download of the hyphenation dictionaries by disabling the component installer. This leaves us the generic (language independent) hyphenation, which is not optimal, but more stable.

What options do we have:

  1. Wait for the hyphenation dictionaries to be downloaded:
    • I'm not sure how to detect that the hyphenation dictionaries have been downloaded. I can write a function that reloads a page and checks the layout, but I'm not sure how to detect precisely that the EN-specific hyphenation is active.
    • It will slow down the test execution.
  2. Disable the component installer and thus the download of the hyphenation dictionaries only for test execution
    • I'm a bit worried that the behaviour we test is going to be different at runtime, so we might have paged.js issues / regressions that we don't catch because they occur when language-specific hyphenation is active. Basically, changing the hyphenation changes the layout, and changing the layout can change the behaviour of paged.js when splitting the content into print pages (you get a different execution path).
  3. Disable the component installer and thus the download of the hyphenation dictionaries at runtime as well, when the Chrome Docker container is managed by us. The downside is that we provide suboptimal hyphenation by default, but at least we know it has been proven to work by our tests. Admins setting up a remote Chrome can still choose to keep the component installer enabled, and thus use language specific hyphenation, with the caveat that it's not fully covered by our tests.

I opted for 3rd option for now, to remove the flickering behaviour.