File tree 1 file changed +12
-4
lines changed 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -94,16 +94,24 @@ def run_and_wait(
94
94
assert self .container is not None
95
95
rv = self .container .wait (timeout = timeout )
96
96
logs = self .get_logs ()
97
- failed = rv ["StatusCode" ] != 0
97
+ rc_success = rv ["StatusCode" ] == 0
98
+ should_report = not (
99
+ no_failure == rc_success
100
+ and no_warnings == (not self .get_warnings (logs ))
101
+ and no_errors == (not self .get_errors (logs ))
102
+ )
98
103
99
- if failed :
104
+ if not rc_success or should_report :
100
105
LOGGER .error (f"Command output:\n { logs } " )
101
106
else :
102
107
LOGGER .debug (f"Command output:\n { logs } " )
103
- assert no_failure != failed
108
+ self .remove ()
109
+
110
+ # To see the reason, we run assert statements separately
111
+ assert no_failure == rc_success
104
112
assert no_warnings == (not self .get_warnings (logs ))
105
113
assert no_errors == (not self .get_errors (logs ))
106
- self . remove ()
114
+
107
115
return logs
108
116
109
117
@staticmethod
You can’t perform that action at this time.
0 commit comments