mbien commented on code in PR #5658:
URL: https://github.com/apache/netbeans/pull/5658#discussion_r1133442892


##########
ide/csl.api/test/unit/src/org/netbeans/modules/csl/api/test/CslTestBase.java:
##########
@@ -2145,6 +2145,14 @@ protected void checkFolds(String relFilePath) throws 
Exception {
 
         ParserManager.parse(Collections.singleton(testSource), new UserTask() {
             public @Override void run(ResultIterator resultIterator) throws 
Exception {
+
+                // FoldingScanner#folds calls source.getDocument(false) and 
receive non null values on JDK 8.
+                // On JDK 11+ however the document is null which leads to test 
failures in FoldingTest#testPHPTags.
+                // This is likely a race condition which is more likely to 
occur on JDK 11+ since the test can be
+                // brute forced to passing on linux if restarted often enough. 
+                // This fixes it by making sure the document is open before 
folds are computed
+                
assertNotNull(resultIterator.getSnapshot().getSource().getDocument(true));
+                

Review Comment:
   since this is in CslTestBase I am wondering if this also stabilizes other 
tests as side effect



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to