Trying to avoid thread deadlock when testing
This commit is contained in:
parent
9967332057
commit
c2bb65bc60
@ -1,4 +1,3 @@
|
||||
language: java
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
- oraclejdk7
|
||||
|
@ -52,7 +52,6 @@ public abstract class AbstractRipper
|
||||
}
|
||||
protected void stopCheck() throws IOException {
|
||||
if (shouldStop) {
|
||||
threadPool.waitForThreads();
|
||||
throw new IOException("Ripping interrupted");
|
||||
}
|
||||
}
|
||||
|
@ -148,16 +148,15 @@ public class VkRipper extends AlbumRipper {
|
||||
}
|
||||
String url = photoIDsToURLs.get(photoID);
|
||||
addURLToDownload(new URL(url));
|
||||
if (isStopped() || isThisATest()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
logger.info("Received " + elements.size() + " elements");
|
||||
if (elements.size() < 40) {
|
||||
|
||||
if (elements.size() < 40 || isStopped() || isThisATest()) {
|
||||
break;
|
||||
}
|
||||
offset += elements.size();
|
||||
|
||||
if (isStopped() || isThisATest()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
waitForThreads();
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ public class VkRipperTest extends RippersTest {
|
||||
}
|
||||
List<URL> contentURLs = new ArrayList<URL>();
|
||||
contentURLs.add(new URL("https://vk.com/album45506334_172415053"));
|
||||
//contentURLs.add(new URL("https://vk.com/album45506334_0"));
|
||||
//contentURLs.add(new URL("https://vk.com/photos45506334"));
|
||||
contentURLs.add(new URL("https://vk.com/album45506334_0"));
|
||||
contentURLs.add(new URL("https://vk.com/photos45506334"));
|
||||
for (URL url : contentURLs) {
|
||||
VkRipper ripper = new VkRipper(url);
|
||||
testRipper(ripper);
|
||||
|
Loading…
Reference in New Issue
Block a user