This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch 5.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.2 by this push:
     new bc74213ff8 PHOENIX-7428 Add usable error message in 
BackwardCompatibilityIT (#2007)
bc74213ff8 is described below

commit bc74213ff8ee41cbdf43f77547b27b1ff96afcbc
Author: Istvan Toth <[email protected]>
AuthorDate: Wed Oct 16 14:17:17 2024 +0200

    PHOENIX-7428 Add usable error message in BackwardCompatibilityIT (#2007)
---
 .../phoenix/end2end/BackwardCompatibilityTestUtil.java       | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityTestUtil.java
 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityTestUtil.java
index 6082967199..7a0ced5594 100644
--- 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityTestUtil.java
+++ 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BackwardCompatibilityTestUtil.java
@@ -41,6 +41,8 @@ import java.io.FileWriter;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
@@ -204,8 +206,14 @@ public final class BackwardCompatibilityTestUtil {
         };
         errorStreamThread.start();
         p.waitFor();
-        assertEquals(String.format("Executing the query failed%s. Check the 
result file: %s",
-                sb.length() > 0 ? sb.append(" with : ").toString() : "", 
resultFilePath),
+        String resultDump = "PLACEHOLDER. Could not read result file";
+        try {
+            resultDump = new 
String(Files.readAllBytes(Paths.get(resultFilePath)));
+        } catch (Exception e) {
+            //We return the placeholder
+        }
+        assertEquals(String.format("Executing the query failed%s. Check the 
result file: %s\nResult file dump follows:\n%s",
+                sb.length() > 0 ? sb.append(" with : ").toString() : "", 
resultFilePath, resultDump),
                 0, p.exitValue());
     }
 

Reply via email to