[
https://issues.apache.org/jira/browse/GEODE-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15709364#comment-15709364
]
ASF GitHub Bot commented on GEODE-1653:
---------------------------------------
Github user gesterzhou commented on a diff in the pull request:
https://github.com/apache/incubator-geode/pull/293#discussion_r90296684
--- Diff:
geode-core/src/test/java/org/apache/geode/internal/cache/FireAndForgetFunctionOnAllServersDUnitTest.java
---
@@ -92,22 +90,23 @@ public void testFireAndForgetFunctionOnAllServers() {
// Step 4. Execute the function to put DistributedMemberID into
above created replicated
// region.
- Function function =
- new TestFunction(false,
TestFunction.TEST_FUNCTION_FIREANDFORGET_ONALL_SERVERS);
+ Function function = new FireAndForgetFunctionOnAllServers();
FunctionService.registerFunction(function);
+ PoolImpl pool = (PoolImpl) pool1;
+
+ await().atMost(60, SECONDS)
+ .until(() -> Assert.assertEquals(1,
pool.getCurrentServers().size()));
+
String regionName = "R1";
Execution dataSet = FunctionService.onServers(pool1);
dataSet.withArgs(regionName).execute(function);
// Using Awatility, if the condition is not met during the timeout, a
// ConditionTimeoutException will be thrown. This makes analyzing
the failure much simpler
- await().atMost(60, SECONDS).until(() -> {
- return (region1.keySetOnServer().size() == 1);
- });
-
// Step 5. Assert for the region keyset size with 1.
- Assert.assertEquals(1, region1.keySetOnServer().size());
+ await().atMost(60, SECONDS)
+ .until(() -> Assert.assertEquals(1,
region1.keySetOnServer().size()));
--- End diff --
The 2 lines should be moved into line 105
> Executing a fire-and-forget function on all servers doesn't actually execute
> on all servers
> -------------------------------------------------------------------------------------------
>
> Key: GEODE-1653
> URL: https://issues.apache.org/jira/browse/GEODE-1653
> Project: Geode
> Issue Type: Bug
> Components: functions
> Reporter: Barry Oglesby
> Assignee: Amey Barve
>
> Executing a fire-and-forget function on all servers only executes on the ones
> the client is currently connected to.
> The two {{ExecuteFunctionNoAckOp execute}} methods get the servers to execute
> against using code like:
> {noformat}
> pool.getCurrentServers();
> {noformat}
> This method just gets all the {{EndpointManager's endpointMap's
> ServerLocations}}.
> What should be done is more like what the {{ExecuteFunctionOp execute}}
> methods do:
> {noformat}
> private static List<ServerLocation> getAllServers(PoolImpl pool) {
> List<ServerLocation> servers = null;
> if (pool.getLocators() == null || pool.getLocators().isEmpty()) {
> servers = ((ExplicitConnectionSourceImpl)
> pool.getConnectionSource()).getAllServers();
> } else {
> servers = ((AutoConnectionSourceImpl)
> pool.getConnectionSource()).findAllServers(); // n/w call on locator
> }
> return servers;
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)