Permalink
Browse files

Tweaked test timeouts to reduce flakiness

  • Loading branch information...
1 parent 3b8ab69 commit 5cde790c3bb98fc4a3c3aeee22d49f69ab78b285 @orfjackal committed Jul 14, 2013
@@ -1,4 +1,4 @@
-// Copyright © 2008-2010 Esko Luontola <www.orfjackal.net>
+// Copyright © 2008-2013 Esko Luontola <www.orfjackal.net>
// This software is released under the Apache License 2.0.
// The license text is at http://dimdwarf.sourceforge.net/LICENSE
@@ -13,7 +13,7 @@
public class AsynchronouslyMatchingByteStreamsTest {
- public static final long TIMEOUT_NEVER_REACHED = 100;
+ public static final long TIMEOUT_NEVER_REACHED = 5000;
public static final long TIMEOUT_IS_REACHED = 1;
@Rule
@@ -55,7 +55,7 @@ public void passes_when_expected_bytes_and_some_more_bytes_arrive() {
@Test
public void fails_when_different_bytes_have_arrived() {
- ByteSink sink = new ByteSink(TIMEOUT_NEVER_REACHED);
+ ByteSink sink = new ByteSink(TIMEOUT_IS_REACHED);
sink.append(IoBuffer.wrap(new byte[]{0x04, 0x05, 0x06}));
@@ -15,14 +15,14 @@
public class AsynchronouslyMatchingOneMessageTest {
- public static final long TIMEOUT_NEVER_REACHED = 100;
+ public static final long TIMEOUT_NEVER_REACHED = 5000;
public static final long TIMEOUT_IS_REACHED = 1;
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test
- public void passes_when_a_matching_event_has_already_arrived() throws InterruptedException {
+ public void passes_when_a_matching_event_has_already_arrived() {
EventSink<String> events = new EventSink<>(TIMEOUT_NEVER_REACHED);
events.append(Arrays.asList("event"));
@@ -31,7 +31,7 @@ public void passes_when_a_matching_event_has_already_arrived() throws Interrupte
}
@Test
- public void passes_when_a_matching_event_arrives_asynchronously() throws InterruptedException {
+ public void passes_when_a_matching_event_arrives_asynchronously() {
final EventSink<String> events = new EventSink<>(TIMEOUT_NEVER_REACHED);
runAsynchronously(new Runnable() {
@@ -44,8 +44,8 @@ public void run() {
}
@Test
- public void fails_when_there_is_a_non_matching_event() throws Throwable {
- EventSink<String> events = new EventSink<>(TIMEOUT_NEVER_REACHED);
+ public void fails_when_there_is_a_non_matching_event() {
+ EventSink<String> events = new EventSink<>(TIMEOUT_IS_REACHED);
events.append(Arrays.asList("non matching event"));
@@ -56,7 +56,7 @@ public void fails_when_there_is_a_non_matching_event() throws Throwable {
}
@Test
- public void fails_due_to_timeout_when_there_are_no_events() throws InterruptedException {
+ public void fails_due_to_timeout_when_there_are_no_events() {
EventSink<String> events = new EventSink<>(TIMEOUT_IS_REACHED);
thrown.expect(AssertionError.class);
@@ -19,7 +19,7 @@ import SimpleSgsProtocolReferenceMessages._
import org.specsy.scala.ScalaSpecsy
class NetworkActorSpec extends ScalaSpecsy {
- val TIMEOUT = 1000L
+ val TIMEOUT = 5000L
val port = SocketUtil.anyFreePort
val toHub = new MessageQueue[Any]("toHub")

0 comments on commit 5cde790

Please sign in to comment.