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
parent
0a1f75a5d9
commit
75cc6e2ed7
|
@ -68,7 +68,7 @@ public abstract class BaseDL4JTest {
|
||||||
* Override this method to set the default timeout for methods in the test class
|
* Override this method to set the default timeout for methods in the test class
|
||||||
*/
|
*/
|
||||||
public long getTimeoutMilliseconds(){
|
public long getTimeoutMilliseconds(){
|
||||||
return 30000;
|
return 60_000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class NearestVertexWalker<V extends SequenceElement> implements GraphWalk
|
||||||
public void reset(boolean shuffle) {
|
public void reset(boolean shuffle) {
|
||||||
position.set(0);
|
position.set(0);
|
||||||
if (shuffle) {
|
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
|
// https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
|
||||||
for (int i = order.length - 1; i > 0; i--) {
|
for (int i = order.length - 1; i > 0; i--) {
|
||||||
int j = rng.nextInt(i + 1);
|
int j = rng.nextInt(i + 1);
|
||||||
|
|
|
@ -249,7 +249,7 @@ public class RandomWalker<T extends SequenceElement> implements GraphWalker<T> {
|
||||||
public void reset(boolean shuffle) {
|
public void reset(boolean shuffle) {
|
||||||
this.position.set(0);
|
this.position.set(0);
|
||||||
if (shuffle) {
|
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
|
// https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm
|
||||||
for (int i = order.length - 1; i > 0; i--) {
|
for (int i = order.length - 1; i > 0; i--) {
|
||||||
int j = rng.nextInt(i + 1);
|
int j = rng.nextInt(i + 1);
|
||||||
|
|
|
@ -101,7 +101,7 @@ public class RandomWalkerTest extends BaseDL4JTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGraphTraverseRandom1() throws Exception {
|
public void testGraphTraverseRandom1() throws Exception {
|
||||||
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graph)
|
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;
|
int cnt = 0;
|
||||||
while (walker.hasNext()) {
|
while (walker.hasNext()) {
|
||||||
|
@ -123,9 +123,10 @@ public class RandomWalkerTest extends BaseDL4JTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGraphTraverseRandom2() throws Exception {
|
public void testGraphTraverseRandom2() throws Exception {
|
||||||
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graph)
|
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graph)
|
||||||
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
|
.setSeed(12345)
|
||||||
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
|
||||||
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
|
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
||||||
|
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
|
||||||
|
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
while (walker.hasNext()) {
|
while (walker.hasNext()) {
|
||||||
|
@ -147,9 +148,9 @@ public class RandomWalkerTest extends BaseDL4JTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGraphTraverseRandom3() throws Exception {
|
public void testGraphTraverseRandom3() throws Exception {
|
||||||
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graph)
|
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graph)
|
||||||
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
|
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
|
||||||
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
||||||
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).build();
|
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).build();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (walker.hasNext()) {
|
while (walker.hasNext()) {
|
||||||
|
@ -169,9 +170,10 @@ public class RandomWalkerTest extends BaseDL4JTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGraphTraverseRandom4() throws Exception {
|
public void testGraphTraverseRandom4() throws Exception {
|
||||||
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graphBig)
|
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graphBig)
|
||||||
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
|
.setSeed(12345)
|
||||||
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
.setNoEdgeHandling(NoEdgeHandling.EXCEPTION_ON_DISCONNECTED).setWalkLength(20)
|
||||||
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
|
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
||||||
|
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
|
||||||
|
|
||||||
Sequence<VocabWord> sequence1 = walker.next();
|
Sequence<VocabWord> sequence1 = walker.next();
|
||||||
|
|
||||||
|
@ -185,8 +187,8 @@ public class RandomWalkerTest extends BaseDL4JTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGraphTraverseRandom5() throws Exception {
|
public void testGraphTraverseRandom5() throws Exception {
|
||||||
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graphBig)
|
RandomWalker<VocabWord> walker = (RandomWalker<VocabWord>) new RandomWalker.Builder<>(graphBig)
|
||||||
.setWalkLength(20).setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
.setWalkLength(20).setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
||||||
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
|
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
|
||||||
|
|
||||||
Sequence<VocabWord> sequence1 = walker.next();
|
Sequence<VocabWord> sequence1 = walker.next();
|
||||||
|
|
||||||
|
@ -200,8 +202,8 @@ public class RandomWalkerTest extends BaseDL4JTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGraphTraverseRandom6() throws Exception {
|
public void testGraphTraverseRandom6() throws Exception {
|
||||||
GraphWalker<VocabWord> walker = new RandomWalker.Builder<>(graphDirected).setWalkLength(20)
|
GraphWalker<VocabWord> walker = new RandomWalker.Builder<>(graphDirected).setWalkLength(20)
|
||||||
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
.setWalkDirection(WalkDirection.FORWARD_UNIQUE)
|
||||||
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
|
.setNoEdgeHandling(NoEdgeHandling.CUTOFF_ON_DISCONNECTED).build();
|
||||||
|
|
||||||
Sequence<VocabWord> sequence = walker.next();
|
Sequence<VocabWord> sequence = walker.next();
|
||||||
assertEquals("0", sequence.getElements().get(0).getLabel());
|
assertEquals("0", sequence.getElements().get(0).getLabel());
|
||||||
|
|
|
@ -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>
|
|
@ -55,7 +55,7 @@ public abstract class BaseND4JTest {
|
||||||
* Override this method to set the default timeout for methods in the test class
|
* Override this method to set the default timeout for methods in the test class
|
||||||
*/
|
*/
|
||||||
public long getTimeoutMilliseconds(){
|
public long getTimeoutMilliseconds(){
|
||||||
return 30000;
|
return 60_000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue