Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The layout tests of the integration project have been flaky, roughly one in three full runs failed in a random
LayoutHarnesstest with "Operations that change non-concurrent collections must have exclusive access". The tests run in parallel, and every container shares the static regex cache and the process-wide adapter, whose caches are plain dictionaries without any locking. The same applies to anyone rendering on several threads, e.g. generating PDFs on a server.RegexParserUtilscaches its regexes in aConcurrentDictionaryFontsHandlertakes a lock around its public methods@font-facecaches ofRAdapterare locked, if two containers load the same face at the same time, the first one is keptThe last one also fixes borders being drawn with the wrong width:
BordersDrawHandlersetWidthandDashStyleon the one shared pen of a color, so a parallel render could draw a 2px border with 1px. As a side effect adouble,grooveetc. border no longer inherits whatever dash style the pen had last, it's solid.The PdfSharp
FontResolverhas the same kind of unlocked lists, the PDF tests don't run in parallel, so that's left for later.How to test this PR?
CI should succeed. Locally nine full integration runs in a row passed, where one in three failed before.
PenCacheTestscovers the pens, the border test fails with the oldBordersDrawHandler.