[ 
https://issues.apache.org/jira/browse/SLING-12250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17817033#comment-17817033
 ] 

Stefan Seifert commented on SLING-12250:
----------------------------------------

the initializing that part of sling resource resolver which also interprets the 
vanity paths changed a couple of times of the last years for performance and 
stability improvements, and is done mostly async in the latest release. as 
using vanity paths in unit test is more an edge case, it makes no sense to 
automatically wait for it's completion for all tests.

if you have a test that really needs vanity paths, probably use libraries like 
[https://github.com/awaitility/awaitility] to wait until it's available and 
then proceed with the tests.

> Adding Resource with sling:vanityPath set causes mismatch when resolving 
> vanity URL (timing issue)
> --------------------------------------------------------------------------------------------------
>
>                 Key: SLING-12250
>                 URL: https://issues.apache.org/jira/browse/SLING-12250
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Testing Sling Mock 3.4.18
>            Reporter: Henry Kuijpers
>            Priority: Major
>
> It could happen that a Resource containing sling:vanityPath is added and then 
> resolved, but the Resource did not end up yet in the vanity logic.
> Observed with JCR_OAK mock context.
> Adding Thread.sleep(1000) fixes the issue, but it's of course not a very good 
> solution.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to