ChinmaySKulkarni commented on a change in pull request #550: PHOENIX-5348: Fix 
flaky test: testIndexRebuildTask
URL: https://github.com/apache/phoenix/pull/550#discussion_r307521007
 
 

 ##########
 File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/DropTableWithViewsIT.java
 ##########
 @@ -166,9 +168,14 @@ public static void assertTaskColumns(Connection conn, 
String expectedStatus, PTa
         String taskStatus = rs.getString(PhoenixDatabaseMetaData.TASK_STATUS);
         assertEquals(expectedStatus, taskStatus);
 
+        if (expectedTableName != null) {
+            String tableName = 
rs.getString(PhoenixDatabaseMetaData.TABLE_NAME);
+            assertEquals(expectedTableName, tableName);
+        }
+
         if (expectedData != null) {
             String data = rs.getString(PhoenixDatabaseMetaData.TASK_DATA);
-            assertEquals(expectedData, data);
+            assertTrue(data.contains(expectedData));
 
 Review comment:
   I ran `DropTableWithViewsIT` and it looks like `data` just gets the value 
`{"TaskDetails":"COMPLETED"}`, whereas when running `IndexMetadataIT`, it gets 
a json such as 
`{"IndexName":"R_ASYNCIND_N000002","RebuildAll":true,"JobID":"job_local1895022878_0001","TaskDetails":"COMPLETED"}`.
 
   
   To make this check more accurate, can we pass in a key and expected value 
and parse the data accordingly? Just checking `contains` may cause us to miss 
actual failures or even lead to false alarms if we change values stored in the 
`TASK_DATA`.

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


With regards,
Apache Git Services

Reply via email to