Quantcast

[HtmlUnit] SVN: [13726] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ WebTestCase.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] SVN: [13726] trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/ WebTestCase.java

asashour-2
Revision: 13726
          http://sourceforge.net/p/htmlunit/code/13726
Author:   asashour
Date:     2017-03-14 08:16:28 +0000 (Tue, 14 Mar 2017)
Log Message:
-----------
wait a little more, when needed

Modified Paths:
--------------
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebTestCase.java

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebTestCase.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebTestCase.java 2017-03-14 08:06:14 UTC (rev 13725)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/WebTestCase.java 2017-03-14 08:16:28 UTC (rev 13726)
@@ -764,6 +764,20 @@
      * @return the threads
      */
     protected static List<Thread> getJavaScriptThreads() {
+        List<Thread> jsThreads = getJavaScriptThreadsImpl();
+        if (!jsThreads.isEmpty()) {
+            try {
+                Thread.sleep(100);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            jsThreads = getJavaScriptThreadsImpl();
+        }
+
+        return jsThreads;
+    }
+
+    private static List<Thread> getJavaScriptThreadsImpl() {
         final Thread[] threads = new Thread[Thread.activeCount() + 10];
         Thread.enumerate(threads);
         final List<Thread> jsThreads = new ArrayList<>();


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Loading...