royteeuwen opened a new pull request, #223: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/223
Same change as #222, on `1.x`. This is the flake that has failed both builds of #221, so #221 stays red until this lands. `AliasMapEntriesTest.test_event_alias_during_bg_init[isOptimizeAliasResolutionEnabled=true,isAliasCacheInitInBackground=true]` keeps stubbing the shared `resourceResolver` mock while the background alias-init thread is parked inside the `findResources` answer. Mockito keeps the invocation being stubbed on the mock's own invocation container rather than per thread, so the stub can bind to `findResources` instead of `getResource` — surfacing either as `WrongTypeOfReturnValue` (PR-221 build #1) or as a silently lost stub that leaves `leaf2` unresolvable (PR-221 build #2, `... should contain an entry for leaf2 ... but got: null`). The fix moves all mock setup ahead of `initializeAliases()`, so the concurrent window contains only `onChange(...)` calls — matching `VanityPathMapEntriesTest.test_remove_vanity_path_during_bg_init`, which is already written that way. `findResources` still returns the pre-removal snapshot, so the events remain the only route into and out of the alias map. ### Verification `AliasMapEntriesTest` 30/30 pass on this branch, and `mvn clean verify`: BUILD SUCCESS, 645 tests, 0 failures. On `master` the same change went from 1 failure in 30 baseline runs to 0 in 60. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
