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

vvcephei pushed a commit to branch 2.3
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.3 by this push:
     new 147956f  MINOR: Fix gradle error writing test stdout (#8133)
147956f is described below

commit 147956fa0ab8a68eec16d95a4a1d888848c21eeb
Author: John Roesler <[email protected]>
AuthorDate: Wed Feb 26 11:10:00 2020 -0600

    MINOR: Fix gradle error writing test stdout (#8133)
    
    Adds a couple of extra checks to the test-output-capturing logic in our 
gradle build.
    Previously, we were seeing a lot of error logs while attempting to write 
output for a
    test whose output file hadn't been initialized.
    
    Reviewers: Ewen Cheslack-Postava <[email protected]>
---
 build.gradle | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index 6fdbd9c..7d39859 100644
--- a/build.gradle
+++ b/build.gradle
@@ -238,7 +238,13 @@ subprojects {
       // code in the test (best guess is that it is tail output from last 
test). We won't have
       // an output file for these, so simply ignore them. If they become 
critical for debugging,
       // they can be seen with showStandardStreams.
-      if (td.name == td.className) {
+      if (td.name == td.className || td.className == null) {
+        // silently ignore output unrelated to specific test methods
+        return
+      } else if (logStreams.get(tid) == null) {
+        println "WARNING: unexpectedly got output for a test [${tid}]" +
+                " that we didn't previously see in the beforeTest hook." +
+                " Message for debugging: [" + toe.message + "]."
         return
       }
       try {

Reply via email to