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