[geode] branch develop updated (6e3e43c -> 6c6b783)

2020-12-15 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

jensdeppe pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git.


from 6e3e43c  GEODE-8665: validate offline-disk-store command is missing 
information (#5801)
 add 6c6b783  GEODE-8577: Ignoring PubSubNativeRedisAcceptanceTest since it 
is still flaky (#5852)

No new revisions were added by this update.

Summary of changes:
 .../redis/internal/executor/pubsub/PubSubNativeRedisAcceptanceTest.java | 2 ++
 1 file changed, 2 insertions(+)



[geode] branch develop updated: GEODE-8665: validate offline-disk-store command is missing information (#5801)

2020-12-15 Thread zhouxj
This is an automated email from the ASF dual-hosted git repository.

zhouxj pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
 new 6e3e43c  GEODE-8665: validate offline-disk-store command is missing 
information (#5801)
6e3e43c is described below

commit 6e3e43c1fa28b4d4b626f9231d677a365051d873
Author: Jianxia Chen <11181423+jche...@users.noreply.github.com>
AuthorDate: Tue Dec 15 13:34:11 2020 -0800

GEODE-8665: validate offline-disk-store command is missing information 
(#5801)
---
 .../cache/ValidateOfflineDiskStoreDUnitTest.java   | 281 +
 .../org/apache/geode/internal/cache/Oplog.java |   6 +
 2 files changed, 287 insertions(+)

diff --git 
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ValidateOfflineDiskStoreDUnitTest.java
 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ValidateOfflineDiskStoreDUnitTest.java
new file mode 100644
index 000..16999bd
--- /dev/null
+++ 
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ValidateOfflineDiskStoreDUnitTest.java
@@ -0,0 +1,281 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache;
+
+import static 
org.apache.geode.distributed.ConfigurationProperties.HTTP_SERVICE_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER;
+import static 
org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_PORT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_START;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_FILE;
+import static 
org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT;
+import static 
org.apache.geode.distributed.ConfigurationProperties.MEMBER_TIMEOUT;
+import static 
org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.internal.lang.SystemPropertyHelper.GEODE_PREFIX;
+import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
+import static org.apache.geode.test.dunit.Disconnect.disconnectAllFromDS;
+import static org.apache.geode.test.dunit.Invoke.invokeInEveryVM;
+import static org.apache.geode.test.dunit.VM.getVM;
+import static org.apache.geode.test.dunit.VM.getVMId;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.PrintStream;
+import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.IntStream;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.cache.client.ClientRegionShortcut;
+import org.apache.geode.distributed.LocatorLauncher;
+import org.apache.geode.distributed.ServerLauncher;
+import org.apache.geode.distributed.internal.InternalLocator;
+import org.apache.geode.internal.lang.SystemPropertyHelper;
+import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.rules.DistributedRule;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+import 
org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder;
+
+public class ValidateOfflineDiskStoreDUnitTest implements Serializable {
+
+  @Rule
+  public transient GfshCommandRule gfsh = new GfshCommandRule();
+
+  @Rule
+  public SerializableTemporaryFolder temporaryFolder = new 
SerializableTemporaryFolder();
+
+  @Rule
+  public DistributedRule distributedRule = new DistributedRule(2);
+
+  private String locatorName;
+
+  private File locatorDir;
+
+  private int locatorPort;
+
+  private int locatorJmxPort;
+
+  private static final LocatorLauncher DUMMY_LOCATOR = 
mock(LocatorLauncher.class);
+
+  private static final AtomicReferen

[geode-native] branch develop updated: GEODE-8775: Add gfsh execute function support (#708)

2020-12-15 Thread mmartell
This is an automated email from the ASF dual-hosted git repository.

mmartell pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git


The following commit(s) were added to refs/heads/develop by this push:
 new 4dd2ceb  GEODE-8775: Add gfsh execute function support (#708)
4dd2ceb is described below

commit 4dd2ceb9ef0dd081039bad76cdb78a3a6cc0a2fd
Author: Michael Martell 
AuthorDate: Tue Dec 15 20:23:11 2020 +

GEODE-8775: Add gfsh execute function support (#708)

* Add gfsh execute function support to the new C++ test framework.
---
 cppcache/integration/framework/Gfsh.cpp | 68 -
 cppcache/integration/framework/Gfsh.h   | 37 +-
 2 files changed, 78 insertions(+), 27 deletions(-)

diff --git a/cppcache/integration/framework/Gfsh.cpp 
b/cppcache/integration/framework/Gfsh.cpp
index 1001c15..17ad576 100644
--- a/cppcache/integration/framework/Gfsh.cpp
+++ b/cppcache/integration/framework/Gfsh.cpp
@@ -29,6 +29,8 @@ Gfsh::Shutdown Gfsh::shutdown() { return Shutdown{*this}; }
 
 Gfsh::Deploy Gfsh::deploy() { return Deploy(*this); }
 
+Gfsh::ExecuteFunction Gfsh::executeFunction() { return ExecuteFunction(*this); 
}
+
 Gfsh::Verb::Verb(Gfsh &gfsh) : gfsh_(gfsh) {}
 
 Gfsh::Start::Start(Gfsh &gfsh) : gfsh_(gfsh) {}
@@ -60,16 +62,17 @@ Gfsh::Start::Locator &Gfsh::Start::Locator::withPort(const 
uint16_t &port) {
   return *this;
 }
 
-Gfsh::Start::Locator &Gfsh::Start::Locator::withRemoteLocators(const 
std::vector &locatorPorts) {
+Gfsh::Start::Locator &Gfsh::Start::Locator::withRemoteLocators(
+const std::vector &locatorPorts) {
   // Example: --J='-Dgemfire.remote-locators=localhost[9009],localhost[9010]'
-  if ( !locatorPorts.empty() ) {
+  if (!locatorPorts.empty()) {
 command_ += " --J='-Dgemfire.remote-locators=";
-bool firstLocator=true;
+bool firstLocator = true;
 for (uint16_t locatorPort : locatorPorts) {
-  if (firstLocator){
+  if (firstLocator) {
 command_ += "localhost[" + std::to_string(locatorPort) + "]";
-firstLocator=false;
-  }else{
+firstLocator = false;
+  } else {
 command_ += ",localhost[" + std::to_string(locatorPort) + "]";
   }
 }
@@ -78,9 +81,10 @@ Gfsh::Start::Locator 
&Gfsh::Start::Locator::withRemoteLocators(const std::vector
   return *this;
 }
 
-Gfsh::Start::Locator &Gfsh::Start::Locator::withDistributedSystemId(const 
uint16_t &dsId) {
-  if ( dsId != 0 ){
-command_ += " --J=-Dgemfire.distributed-system-id="+std::to_string(dsId);
+Gfsh::Start::Locator &Gfsh::Start::Locator::withDistributedSystemId(
+const uint16_t &dsId) {
+  if (dsId != 0) {
+command_ += " --J=-Dgemfire.distributed-system-id=" + std::to_string(dsId);
   }
   return *this;
 }
@@ -395,38 +399,49 @@ Gfsh::Create::Region 
&Gfsh::Create::Region::withType(const std::string &type) {
   return *this;
 }
 
-Gfsh::Create::Region &Gfsh::Create::Region::withRedundantCopies(const 
std::string &copies) {
+Gfsh::Create::Region &Gfsh::Create::Region::withRedundantCopies(
+const std::string &copies) {
   command_ += " --redundant-copies=" + copies;
   return *this;
 }
 
-Gfsh::Create::Region &Gfsh::Create::Region::withBuckets(const std::string 
&totalNumBuckets) {
+Gfsh::Create::Region &Gfsh::Create::Region::withBuckets(
+const std::string &totalNumBuckets) {
   command_ += " --total-num-buckets=" + totalNumBuckets;
   return *this;
 }
 
-Gfsh::Create::Region &Gfsh::Create::Region::withGatewaySenderId(const 
std::string &gatewaySenderId) {
+Gfsh::Create::Region &Gfsh::Create::Region::withGatewaySenderId(
+const std::string &gatewaySenderId) {
   command_ += " --gateway-sender-id=" + gatewaySenderId;
   return *this;
 }
 
-Gfsh::Create::GatewaySender Gfsh::Create::gatewaySender() { return 
GatewaySender{gfsh_}; }
+Gfsh::Create::GatewaySender Gfsh::Create::gatewaySender() {
+  return GatewaySender{gfsh_};
+}
 
-Gfsh::Create::GatewaySender::GatewaySender(Gfsh &gfsh) : Command(gfsh, "create 
gateway-sender") {}
+Gfsh::Create::GatewaySender::GatewaySender(Gfsh &gfsh)
+: Command(gfsh, "create gateway-sender") {}
 
-Gfsh::Create::GatewaySender &Gfsh::Create::GatewaySender::withId(const 
std::string &id){
+Gfsh::Create::GatewaySender &Gfsh::Create::GatewaySender::withId(
+const std::string &id) {
   command_ += " --id=" + id;
   return *this;
 }
 
-Gfsh::Create::GatewaySender &Gfsh::Create::GatewaySender::withRemoteDSId(const 
std::string &remoteDSId){
+Gfsh::Create::GatewaySender &Gfsh::Create::GatewaySender::withRemoteDSId(
+const std::string &remoteDSId) {
   command_ += " --remote-distributed-system-id=" + remoteDSId;
   return *this;
 }
 
-Gfsh::Create::GatewayReceiver Gfsh::Create::gatewayReceiver() { return 
GatewayReceiver{gfsh_}; }
+Gfsh::Create::GatewayReceiver Gfsh::Create::gatewayReceiver() {
+  return GatewayReceiver{gfsh_};
+}
 
-Gfsh::Create::GatewayReceiver::GatewayReceiver(Gfsh &gfsh) : Command(gfsh

[geode] branch develop updated: GEODE-8769: Help ensure redis stats are settled before testing (#5849)

2020-12-15 Thread jensdeppe
This is an automated email from the ASF dual-hosted git repository.

jensdeppe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
 new b730658  GEODE-8769: Help ensure redis stats are settled before 
testing (#5849)
b730658 is described below

commit b730658b7a713ad7566485087be6b22d0469c91d
Author: John Hutchison 
AuthorDate: Tue Dec 15 11:38:19 2020 -0500

GEODE-8769: Help ensure redis stats are settled before testing (#5849)

- add await to be sure connections are closed in after

Co-authored-by: John Hutchison 
Co-authored-by: Helena A. Bales 
---
 .../redis/internal/RedisStatsIntegrationTest.java  | 167 -
 .../apache/geode/redis/internal/RedisStats.java|  25 +--
 .../internal/executor/server/InfoExecutor.java |   2 +-
 3 files changed, 97 insertions(+), 97 deletions(-)

diff --git 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/RedisStatsIntegrationTest.java
 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/RedisStatsIntegrationTest.java
index ae90cd9..b49863f 100644
--- 
a/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/RedisStatsIntegrationTest.java
+++ 
b/geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/RedisStatsIntegrationTest.java
@@ -49,6 +49,10 @@ public class RedisStatsIntegrationTest {
   private static long START_TIME;
   private static StatisticsClock statisticsClock;
 
+  private Long preTestKeySpaceHits = 0l;
+  private Long preTestKeySpaceMisses = 0l;
+  private Long preTestConnectionsReceived = 0l;
+  private Long preTestConnectedClients = 0l;
 
 
   @ClassRule
@@ -64,19 +68,32 @@ public class RedisStatsIntegrationTest {
   public void before() {
 jedis = new Jedis("localhost", server.getPort(), TIMEOUT);
 
+redisStats = server.getServer().getStats();
+
+long preSetupCommandsProcessed = redisStats.getCommandsProcessed();
+
 jedis.set(EXISTING_STRING_KEY, "A_Value");
 jedis.hset(EXISTING_HASH_KEY, "Field1", "Value1");
 jedis.sadd(EXISTING_SET_KEY_1, "m1", "m2", "m3");
 jedis.sadd(EXISTING_SET_KEY_2, "m4", "m5", "m6");
 
-redisStats = server.getServer().getStats();
-redisStats.clearAllStats();
+GeodeAwaitility.await().atMost(Duration.ofSeconds(2))
+.untilAsserted(() -> assertThat(redisStats.getCommandsProcessed())
+.isEqualTo(preSetupCommandsProcessed + 4));
+
+preTestKeySpaceHits = redisStats.getKeyspaceHits();
+preTestKeySpaceMisses = redisStats.getKeyspaceMisses();
+preTestConnectionsReceived = redisStats.getTotalConnectionsReceived();
+preTestConnectedClients = redisStats.getConnectedClients();
   }
 
   @After
   public void after() {
 jedis.flushAll();
 jedis.close();
+GeodeAwaitility.await().atMost(Duration.ofSeconds(2))
+.untilAsserted(() -> assertThat(redisStats.getConnectedClients())
+.isEqualTo(0));
   }
 
   // #Stats Section###
@@ -86,10 +103,10 @@ public class RedisStatsIntegrationTest {
 jedis.get(EXISTING_STRING_KEY);
 
 assertThat(redisStats.getKeyspaceHits())
-.isEqualTo(1);
+.isEqualTo(preTestKeySpaceHits + 1);
 
 assertThat(redisStats.getKeyspaceMisses())
-.isEqualTo(0);
+.isEqualTo(preTestKeySpaceMisses);
   }
 
   @Test
@@ -98,9 +115,9 @@ public class RedisStatsIntegrationTest {
 jedis.get("Nonexistent_Key");
 
 assertThat(redisStats.getKeyspaceHits())
-.isEqualTo(0);
+.isEqualTo(preTestKeySpaceHits);
 assertThat(redisStats.getKeyspaceMisses())
-.isEqualTo(1);
+.isEqualTo(preTestKeySpaceMisses + 1);
   }
 
   // TODO: Set doesn't work like native Redis!
@@ -109,9 +126,9 @@ public class RedisStatsIntegrationTest {
 jedis.set(EXISTING_STRING_KEY, "New_Value");
 
 assertThat(redisStats.getKeyspaceHits())
-.isEqualTo(1);
+.isEqualTo(preTestKeySpaceHits + 1);
 assertThat(redisStats.getKeyspaceMisses())
-.isEqualTo(0);
+.isEqualTo(preTestKeySpaceMisses);
   }
 
   // TODO: Set doesn't work like native Redis!
@@ -120,9 +137,9 @@ public class RedisStatsIntegrationTest {
 jedis.set("Another_Key", "Another_Value");
 
 assertThat(redisStats.getKeyspaceHits())
-.isEqualTo(0);
+.isEqualTo(preTestKeySpaceHits);
 assertThat(redisStats.getKeyspaceMisses())
-.isEqualTo(1);
+.isEqualTo(preTestKeySpaceMisses + 1);
   }
 
   @Test
@@ -130,9 +147,9 @@ public class RedisStatsIntegrationTest {
 jedis.getbit(EXISTING_STRING_KEY, 0);
 
 assertThat(redisStats.getKeyspaceHits())
-.isEqualTo(1);
+.isEqualTo(preTestKeySpaceHits + 1);
 assertThat(redisStats.getKeyspaceMisses())
-.isEqualTo(0);
+.isEqualTo(preTestKeySpaceMisses);
   }
 
   @Test
@@ -140,9 +157,9 @@ public class