rombert commented on a change in pull request #5: SLING-7544 - improving
optimized alias lookup to not block during int…
URL:
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/5#discussion_r176089556
##########
File path:
src/test/java/org/apache/sling/resourceresolver/impl/mapping/MapEntriesTest.java
##########
@@ -168,6 +172,8 @@ public void test_simple_alias_support() {
});
mapEntries.doInit();
+
+ while(!mapEntries.isAliasMapInitialized()){}
Review comment:
An empty loop looks wrong. I know what it does :-) but it looks wrong. I
would suggest either adding a method to mapEntries for waiting for it to be
available or using a test helper method.
Also please add timeouts to all methods having such async logic to prevent
them from hanging indefinitely under special circumstances.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services