dschneider-pivotal commented on a change in pull request #6926:
URL: https://github.com/apache/geode/pull/6926#discussion_r725389495



##########
File path: 
geode-for-redis/src/distributedTest/java/org/apache/geode/redis/OutOfMemoryDUnitTest.java
##########
@@ -103,7 +104,51 @@ public void 
shouldReturnOOMError_forWriteOperations_whenThresholdReached()
     fillMemory(jedis, false);
 
     assertThatThrownBy(
-        () -> jedis.set("{key}oneMoreKey", makeLongStringValue(2 * 
LARGE_VALUE_SIZE)))
+        () -> jedis.set("{key}oneMoreKey", "value"))
+            .hasMessageContaining("OOM");
+
+    memoryPressureThread.interrupt();
+    memoryPressureThread.join();
+  }
+
+  @Test
+  public void shouldReturnOOMError_forSubscribe_whenThresholdReached()
+      throws InterruptedException {
+    IgnoredException.addIgnoredException(expectedEx);
+    IgnoredException.addIgnoredException("LowMemoryException");
+    MockSubscriber mockSubscriber = new MockSubscriber();
+    int redisServerPort1 = clusterStartUp.getRedisPort(1);
+    JedisCluster subJedis =
+        new JedisCluster(new HostAndPort(BIND_ADDRESS, redisServerPort1), 
REDIS_CLIENT_TIMEOUT);
+
+    memoryPressureThread = new Thread(makeMemoryPressureRunnable());

Review comment:
       Thanks for the feedback. Given that OutOfMemoryDUnitTest was already 
written to create its own threads and join on them and I just followed that 
existing pattern in adding publish and subscribe coverage; I'm going to file a 
new ticket with your suggested improvements to this test instead of doing it in 
this rather large PR.




-- 
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]


Reply via email to