From 95f382746885edc5d65d434cd468d17ff92631de Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Wed, 5 Jun 2024 17:57:05 -0600 Subject: [PATCH] bug fix --- .../src/main/scala/org/apache/comet/fuzz/QueryRunner.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fuzz-testing/src/main/scala/org/apache/comet/fuzz/QueryRunner.scala b/fuzz-testing/src/main/scala/org/apache/comet/fuzz/QueryRunner.scala index b2ceae9d0..f928c93a2 100644 --- a/fuzz-testing/src/main/scala/org/apache/comet/fuzz/QueryRunner.scala +++ b/fuzz-testing/src/main/scala/org/apache/comet/fuzz/QueryRunner.scala @@ -19,7 +19,7 @@ package org.apache.comet.fuzz -import java.io.{BufferedWriter, FileWriter, PrintWriter} +import java.io.{BufferedWriter, FileWriter, PrintWriter, StringWriter} import scala.io.Source @@ -111,9 +111,11 @@ object QueryRunner { showSQL(w, sql) w.write(s"[ERROR] Query failed in Comet: ${e.getMessage}:\n") w.write("```\n") - val p = new PrintWriter(w) + val sw = new StringWriter() + val p = new PrintWriter(sw) e.printStackTrace(p) p.close() + w.write(s"${sw.toString}\n") w.write("```\n") }