[xwiki/xwiki-commons] 39d0e1: XCOMMONS-2092: Possible race condition in ReadWrit...
Branch: refs/heads/XCOMMONS-2092 Home: https://github.com/xwiki/xwiki-commons Commit: 39d0e1b115c5c1ed196c72fedad649a3cbc99dad https://github.com/xwiki/xwiki-commons/commit/39d0e1b115c5c1ed196c72fedad649... Author: Vincent Massol <[email protected]> Date: 2026-09-17 (Thu, 17 Sep 2026) Changed paths: M xwiki-commons-core/xwiki-commons-job/xwiki-commons-job-default/src/test/java/org/xwiki/job/internal/DefaultJobExecutorTest.java Log Message: ----------- XCOMMONS-2092: Possible race condition in ReadWriteSemaphore * Replace the java:S5961 suppression added by the previous commit with an actual cleanup of DefaultJobExecutorTest. SonarJava counts assertions reached through private helpers, so 10 of the 28 it reported on matchingGroupPathAreBlockedPoolMultiSizeParentFirst were the fail() inside waitJobState(), and 12 of the 18 remaining direct assertions only restated the state the waitJobXxx() call right above them had already established. * Drop those pure restatements in the three matchingGroupPath* tests, keeping every assertNull() (a job that must not have started yet is the property under test) and every "still in that state" re-check no preceding wait covers. Assertion counts as SonarJava computes them: 28 -> 21, 29 -> 21 and 18 -> 12. Splitting the methods instead was rejected: each one is a single choreography over live threads whose assertions are checkpoints on one timeline, so every split test would have to replay all the steps before its own. * Extract the repeated GroupedJobInitializer stubbing into mockPool(poolSize, path...) and mockAllPools(poolSize), so each test opens with the pool sizes its scenario comment describes. * Remove a duplicated assertion on job1 at the end of matchingGroupPathAreBlocked. It was meant to be on job12, whose final state the assertion above it already covers. * Fix two comments mangled by a search and replace ("taken into ABcount", "they are ABtually after"). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-commons/settings/notifications
participants (1)
-
XWiki Notifications