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

brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 37081687 Fail more directly when errors are found in logs
37081687 is described below

commit 3708168724aa4937cdfeaa843bdb3820039ad15e
Author: Brandon Williams <brandonwilli...@apache.org>
AuthorDate: Tue Sep 20 11:35:34 2022 -0500

    Fail more directly when errors are found in logs
    
    Patch by brandonwilliams; reviewed by mck for CASSANDRA-17901
---
 conftest.py    | 2 +-
 dtest_setup.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/conftest.py b/conftest.py
index 19c30832..fac8f26d 100644
--- a/conftest.py
+++ b/conftest.py
@@ -365,7 +365,7 @@ def fixture_dtest_setup(request,
         except Exception as e:
             logger.error("Error saving log:", str(e))
         finally:
-            dtest_setup.cleanup_cluster(request)
+            dtest_setup.cleanup_cluster(request, failed)
 
 
 # Based on https://bugs.python.org/file25808/14894.patch
diff --git a/dtest_setup.py b/dtest_setup.py
index 3d37c9d6..394dc2f4 100644
--- a/dtest_setup.py
+++ b/dtest_setup.py
@@ -386,9 +386,9 @@ class DTestSetup(object):
         """
         self.log_watch_thread.join(timeout=60)
 
-    def cleanup_cluster(self, request=None):
+    def cleanup_cluster(self, request=None, failure=False):
         with log_filter('cassandra'):  # quiet noise from driver when nodes 
start going down
-            test_failed = request and hasattr(request.node, 'rep_call') and 
request.node.rep_call.failed
+            test_failed = (request and hasattr(request.node, 'rep_call') and 
request.node.rep_call.failed) or failure
             if self.dtest_config.keep_test_dir or 
(self.dtest_config.keep_failed_test_dir and test_failed):
                 
self.cluster.stop(gently=self.dtest_config.enable_jacoco_code_coverage)
             else:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to