rohdesamuel commented on a change in pull request #12984:
URL: https://github.com/apache/beam/pull/12984#discussion_r504158869



##########
File path: 
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/HotKeyLoggerTest.java
##########
@@ -50,18 +45,29 @@ public void SetUp() {
   }
 
   @Test
-  public void correctHotKeyMessage() {
+  public void correctHotKeyMessageWithoutKey() {
     HotKeyLogger hotKeyLogger = new HotKeyLogger(clock);
 
-    assertFalse(hotKeyLogger.isThrottled());
-    String m = hotKeyLogger.getHotKeyMessage("TEST_STEP_ID", "1s");
+    hotKeyLogger.logHotKeyDetection("TEST_STEP_ID", 
Duration.standardSeconds(1));
     assertTrue(hotKeyLogger.isThrottled());
 
-    assertEquals(
+    expectedLogs.verifyWarn(
         "A hot key was detected in step 'TEST_STEP_ID' with age of '1s'. This 
is a "
             + "symptom of key distribution being skewed. To fix, please 
inspect your data and "
-            + "pipeline to ensure that elements are evenly distributed across 
your key space.",
-        m);
+            + "pipeline to ensure that elements are evenly distributed across 
your key space.");
+  }
+
+  @Test
+  public void correctHotKeyMessageWithKey() {

Review comment:
       Done




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


Reply via email to