Increase default timeouts [WIP] (#407)

* Increase default test timeout to 60 sec due to slow PPC CI machines

Signed-off-by: Alex Black <blacka101@gmail.com>

* Fix flaky NLP test (randomly fails due to no RNG seed set)

Signed-off-by: Alex Black <blacka101@gmail.com>
master
Alex Black 2020-04-23 10:46:42 +10:00 committed by GitHub
parent 0a1f75a5d9
commit 75cc6e2ed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 18 deletions

View File

@ -68,7 +68,7 @@ public abstract class BaseDL4JTest {
* Override this method to set the default timeout for methods in the test class
*/
public long getTimeoutMilliseconds(){
return 30000;
return 60_000;
}
/**

View File

@ -70,7 +70,7 @@ public class NearestVertexWalker<V extends SequenceElement> implements GraphWalk
public void reset(boolean shuffle) {
position.set(0);
if (shuffle) {
log.debug("Calling shuffle() on entries...");
log.trace("Calling shuffle() on entries...");
// https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
for (int i = order.length - 1; i > 0; i--) {
int j = rng.nextInt(i + 1);

View File

@ -249,7 +249,7 @@ public class RandomWalker<T extends SequenceElement> implements GraphWalker<T> {
public void reset(boolean shuffle) {
this.position.set(0);
if (shuffle) {
logger.debug("Calling shuffle() on entries...");
logger.trace("Calling shuffle() on entries...");
// https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
for (int i = order.length - 1; i > 0; i--) {
int j = rng.nextInt(i + 1);

View File

@ -101,7 +101,7 @@ public class RandomWalkerTest extends BaseDL4JTest {
@Test
public void testGraphTraverseRandom1() throws Exception {
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graph)
.setNoEdgeHandling(NoEdgeHandling.SELF_LOOP_ON_DISCONNECTED).setWalkLength(3).build();
.setNoEdgeHandling(NoEdgeHandling.SELF_LOOP_ON_DISCONNECTED).setWalkLength(3).build();
int cnt = 0;
while (walker.hasNext()) {
@ -123,9 +123,10 @@ public class RandomWalkerTest extends BaseDL4JTest {
@Test
public void testGraphTraverseRandom2() throws Exception {
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graph)
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
.setSeed(12345)
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
int cnt = 0;
while (walker.hasNext()) {
@ -147,9 +148,9 @@ public class RandomWalkerTest extends BaseDL4JTest {
@Test
public void testGraphTraverseRandom3() throws Exception {
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graph)
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).build();
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).build();
try {
while (walker.hasNext()) {
@ -169,9 +170,10 @@ public class RandomWalkerTest extends BaseDL4JTest {
@Test
public void testGraphTraverseRandom4() throws Exception {
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graphBig)
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
.setSeed(12345)
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
Sequence<VocabWord> sequence1 = walker.next();
@ -185,8 +187,8 @@ public class RandomWalkerTest extends BaseDL4JTest {
@Test
public void testGraphTraverseRandom5() throws Exception {
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graphBig)
.setWalkLength(20).setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
.setWalkLength(20).setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
Sequence<VocabWord> sequence1 = walker.next();
@ -200,8 +202,8 @@ public class RandomWalkerTest extends BaseDL4JTest {
@Test
public void testGraphTraverseRandom6() throws Exception {
GraphWalker<VocabWord> walker = new RandomWalker.Builder<>(graphDirected).setWalkLength(20)
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
Sequence<VocabWord> sequence = walker.next();
assertEquals("0", sequence.getElements().get(0).getLabel());

View File

@ -0,0 +1,50 @@
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright (c) 2015-2018 Skymind, Inc.
~
~ This program and the accompanying materials are made available under the
~ terms of the Apache License, Version 2.0 which is available at
~ https://www.apache.org/licenses/LICENSE-2.0.
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
~
~ SPDX-License-Identifier: Apache-2.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<configuration>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/application.log</file>
<encoder>
<pattern> %logger{15} - %message%n%xException{5}
</pattern>
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern> %logger{15} - %message%n%xException{5}
</pattern>
</encoder>
</appender>
<logger name="org.apache.catalina.core" level="DEBUG" />
<logger name="org.springframework" level="DEBUG" />
<logger name="org.deeplearning4j" level="INFO" />
<logger name="org.datavec" level="INFO" />
<logger name="org.nd4j" level="INFO" />
<logger name="opennlp.uima.util" level="OFF" />
<logger name="org.apache.uima" level="OFF" />
<logger name="org.cleartk" level="OFF" />
<root level="ERROR">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>

View File

@ -55,7 +55,7 @@ public abstract class BaseND4JTest {
* Override this method to set the default timeout for methods in the test class
*/
public long getTimeoutMilliseconds(){
return 30000;
return 60_000;
}
/**