|
34 | 34 | import static org.apache.geode.test.awaitility.GeodeAwaitility.await; |
35 | 35 | import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException; |
36 | 36 | import static org.assertj.core.api.Assertions.assertThat; |
| 37 | +import static org.assertj.core.api.Assertions.fail; |
37 | 38 |
|
38 | 39 | import java.text.NumberFormat; |
39 | 40 | import java.text.ParseException; |
40 | 41 | import java.util.Arrays; |
41 | 42 | import java.util.Collections; |
| 43 | +import java.util.LinkedList; |
42 | 44 | import java.util.List; |
43 | 45 | import java.util.Locale; |
44 | 46 | import java.util.Properties; |
|
73 | 75 | import org.apache.geode.management.internal.cli.util.CommandStringBuilder; |
74 | 76 | import org.apache.geode.management.internal.i18n.CliStrings; |
75 | 77 | import org.apache.geode.test.dunit.AsyncInvocation; |
| 78 | +import org.apache.geode.test.dunit.IgnoredException; |
76 | 79 | import org.apache.geode.test.dunit.VM; |
77 | 80 | import org.apache.geode.test.dunit.rules.DistributedErrorCollector; |
78 | 81 | import org.apache.geode.test.dunit.rules.DistributedExecutorServiceRule; |
@@ -1166,12 +1169,28 @@ private int create2WanSitesAndClient(VM locatorInA, List<VM> serversInA, String |
1166 | 1169 |
|
1167 | 1170 | private void createSender(boolean isParallelGatewaySender, List<VM> servers, |
1168 | 1171 | String senderId, int remoteDsId) { |
1169 | | - for (VM server : servers) { |
1170 | | - server.invoke(() -> createSender(senderId, remoteDsId, isParallelGatewaySender, |
1171 | | - 100, 10, false, |
1172 | | - false, null, true)); |
| 1172 | + List<AsyncInvocation<Void>> tasks = new LinkedList<>(); |
| 1173 | + for (VM vm : servers) { |
| 1174 | + tasks.add(vm.invokeAsync( |
| 1175 | + () -> vm.invoke(() -> { |
| 1176 | + IgnoredException ignoreInterruptedException = |
| 1177 | + addIgnoredException(InterruptedException.class.getName()); |
| 1178 | + try { |
| 1179 | + createSender(senderId, remoteDsId, isParallelGatewaySender, |
| 1180 | + 100, 10, false, |
| 1181 | + false, null, false); |
| 1182 | + } finally { |
| 1183 | + ignoreInterruptedException.remove(); |
| 1184 | + } |
| 1185 | + }))); |
| 1186 | + } |
| 1187 | + for (AsyncInvocation<Void> invocation : tasks) { |
| 1188 | + try { |
| 1189 | + invocation.await(); |
| 1190 | + } catch (InterruptedException e) { |
| 1191 | + fail("Creating and starting senders was interrupted"); |
| 1192 | + } |
1173 | 1193 | } |
1174 | | - startSenderInVMsAsync(senderId, servers.toArray(new VM[0])); |
1175 | 1194 | } |
1176 | 1195 |
|
1177 | 1196 | private void createReceivers(List<VM> serversInB, VM serverInC) { |
|
0 commit comments