kirklund commented on a change in pull request #6246:
URL: https://github.com/apache/geode/pull/6246#discussion_r605281830
##########
File path:
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
##########
@@ -877,10 +877,42 @@ public void testSplitBrain() {
createReplicateRegion(regionName, getDiskDirs(getVMId()));
});
assertThat(thrown).isInstanceOf(ConflictingPersistentDataException.class);
+ assertThat(thrown.getMessage())
+ .contains("was not part of the same distributed system as the
local data");
Review comment:
Typically you should just use `thrown` as the subject for the assertion
rather than `thrown.getMessage()`:
```
assertThat(thrown).hasMessageContaining("was not part of the same
distributed system as the local data");
```
That way you can chain together multiple details:
```
assertThat(thrown)
.isInstanceOf(ConflictingPersistentDataException.class)
.hasMessageContaining("was not part of the same distributed system as
the local data");
```
...and you could even check `hasCauseInstanceOf` or other options.
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java
##########
@@ -510,18 +510,19 @@ public PersistentMembershipView getMembershipView() {
public boolean checkMyStateOnMembers(Set<InternalDistributedMember>
replicates)
throws ReplyException {
PersistentStateQueryResults remoteStates = getMyStateOnMembers(replicates);
+ Set<InternalDistributedMember> copyOfReplicates = new HashSet<>();
+ copyOfReplicates.addAll(replicates);
Review comment:
You can shrink this down to one statement:
```
Set<InternalDistributedMember> copyOfReplicates = new HashSet<>(replicates);
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]