Skip to content

Commit

Permalink
Improves some of the timeouts for the peer forwarder tests to reduce …
Browse files Browse the repository at this point in the history
…testing time. (#3020)

Signed-off-by: David Venable <[email protected]>
  • Loading branch information
dlvenable authored Jul 25, 2023
1 parent fb221a6 commit ca6a993
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PeerForwarderReceiveBufferTest {
private static final int TEST_BATCH_SIZE = 3;
private static final int TEST_BUFFER_SIZE = 13;
private static final int TEST_WRITE_TIMEOUT = 100;
private static final int TEST_BATCH_READ_TIMEOUT = 5_000;
private static final int TEST_BATCH_READ_TIMEOUT = 200;
private static final ExecutorService EXECUTOR = Executors.newSingleThreadExecutor();
private static final String PIPELINE_NAME = UUID.randomUUID().toString();
private static final String PLUGIN_ID = UUID.randomUUID().toString();
Expand Down Expand Up @@ -204,7 +204,7 @@ void testNonZeroBatchDelayReturnsAllRecords() throws Exception {
final Collection<Record<String>> testRecords2 = generateBatchRecords(1);
EXECUTOR.submit(() -> {
try {
Thread.sleep(1000);
Thread.sleep(TEST_BATCH_READ_TIMEOUT / 5);
peerForwarderReceiveBuffer.writeAll(testRecords2, TEST_WRITE_TIMEOUT);
} catch (final Exception e) {
throw new RuntimeException(e);
Expand All @@ -229,7 +229,7 @@ void testZeroBatchDelayReturnsAvailableRecords() throws Exception {
final Collection<Record<String>> testRecords2 = generateBatchRecords(1);
EXECUTOR.submit(() -> {
try {
Thread.sleep(1000);
Thread.sleep(TEST_BATCH_READ_TIMEOUT / 5);
peerForwarderReceiveBuffer.writeAll(testRecords2, TEST_WRITE_TIMEOUT);
} catch (final Exception e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private Collection<Record<Event>> getServerSideRecords(final PeerForwarderProvid
assertThat(pluginBufferMap, notNullValue());
final PeerForwarderReceiveBuffer<Record<Event>> receiveBuffer = pluginBufferMap.get(pluginId);

final Map.Entry<Collection<Record<Event>>, CheckpointState> bufferEntry = receiveBuffer.read(1000);
final Map.Entry<Collection<Record<Event>>, CheckpointState> bufferEntry = receiveBuffer.read(400);
return bufferEntry.getKey();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@
class RemotePeerForwarderTest {
private static final int TEST_BUFFER_CAPACITY = 20;
private static final int TEST_BATCH_SIZE = 20;
private static final int TEST_BATCH_DELAY = 3_000;
private static final int TEST_LOCAL_WRITE_TIMEOUT = 500;
private static final int TEST_TIMEOUT_IN_MILLIS = 500;
private static final int TEST_BATCH_DELAY = 800;
private static final int TEST_LOCAL_WRITE_TIMEOUT = 400;
private static final int TEST_TIMEOUT_IN_MILLIS = 400;
private static final int FORWARDING_BATCH_SIZE = 5;
private static final int FORWARDING_BATCH_QUEUE_DEPTH = 1;
private static final Duration FORWARDING_BATCH_TIMEOUT = Duration.of(3, ChronoUnit.SECONDS);
private static final Duration FORWARDING_BATCH_TIMEOUT = Duration.of(800, ChronoUnit.MILLIS);
private static final int PIPELINE_WORKER_THREADS = 3;
private static final String PIPELINE_NAME = UUID.randomUUID().toString();
private static final String PLUGIN_ID = UUID.randomUUID().toString();
Expand Down

0 comments on commit ca6a993

Please sign in to comment.