Skip to content

Commit

Permalink
Fix for the timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jvarenina committed Sep 19, 2022
1 parent 85de201 commit b858edc
Showing 1 changed file with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;

import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Properties;
Expand Down Expand Up @@ -73,6 +75,7 @@
import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
import org.apache.geode.management.internal.i18n.CliStrings;
import org.apache.geode.test.dunit.AsyncInvocation;
import org.apache.geode.test.dunit.IgnoredException;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.rules.DistributedErrorCollector;
import org.apache.geode.test.dunit.rules.DistributedExecutorServiceRule;
Expand Down Expand Up @@ -1166,12 +1169,28 @@ private int create2WanSitesAndClient(VM locatorInA, List<VM> serversInA, String

private void createSender(boolean isParallelGatewaySender, List<VM> servers,
String senderId, int remoteDsId) {
for (VM server : servers) {
server.invoke(() -> createSender(senderId, remoteDsId, isParallelGatewaySender,
100, 10, false,
false, null, true));
List<AsyncInvocation<Void>> tasks = new LinkedList<>();
for (VM vm : servers) {
tasks.add(vm.invokeAsync(
() -> vm.invoke(() -> {
IgnoredException ignoreInterruptedException =
addIgnoredException(InterruptedException.class.getName());
try {
createSender(senderId, remoteDsId, isParallelGatewaySender,
100, 10, false,
false, null, false);
} finally {
ignoreInterruptedException.remove();
}
})));
}
for (AsyncInvocation<Void> invocation : tasks) {
try {
invocation.await();
} catch (InterruptedException e) {
fail("Creating and starting senders was interrupted");
}
}
startSenderInVMsAsync(senderId, servers.toArray(new VM[0]));
}

private void createReceivers(List<VM> serversInB, VM serverInC) {
Expand Down

0 comments on commit b858edc

Please sign in to comment.