kirklund commented on a change in pull request #6036:
URL: https://github.com/apache/geode/pull/6036#discussion_r694209000
##########
File path:
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
##########
@@ -158,10 +158,18 @@ public void
testPartitionedRegionWithPersistentGatewaySender() {
LogWriterUtils.getLogWriter().info("Started the senders");
- vm2.invoke(
- () -> WANTestBase.createPartitionedRegion(getTestMethodName(), null,
1, 100, isOffHeap()));
- vm3.invoke(
- () -> WANTestBase.createPartitionedRegion(getTestMethodName(), null,
1, 100, isOffHeap()));
+ AsyncInvocation inv1 = vm2.invokeAsync(() -> WANTestBase
+ .createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100,
isOffHeap()));
+ AsyncInvocation inv2 = vm3.invokeAsync(() -> WANTestBase
+ .createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100,
isOffHeap()));
+ try {
+ inv1.join();
+ inv2.join();
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ fail();
+ }
Review comment:
If you're going to use `AsyncInvocation` please add a type such as
`Void`, use `await()`, give a useful name to the variable, remove the
try-catch, and add any exceptions such as `InterruptedException` to the
`throws` clause of the test:
```
public void testPartitionedRegionWithPersistentGatewaySender() throws
InterruptedException {
...
AsyncInvocation<Void> createPersistentPartitionedRegionAsync =
vm2.invokeAsync(() -> WANTestBase
.createPersistentPartitionedRegion(getTestMethodName(), null, 1,
100, isOffHeap()));
...
createPersistentPartitionedRegionAsync.await();
}
```
As @albertogpz pointed out, there's really not enough value to doing to this
for creation of a region.
I usually only do the above when it's really valuable to the test itself
such as two member performing region operations. When I do that I name the
`AsyncInvocation` something like this:
```
AsyncInvocation<Void> performPuts = ...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]