@@ -1555,11 +1555,6 @@ def setup(self, skip_provision: bool = False):
15551555
15561556 def teardown (self , publish_artifacts : bool = True ):
15571557 try :
1558- if not self .vm_alive :
1559- for _ , stage_data in self .artifacts .items ():
1560- self .vm_alive = check_for_error_string (stage_data )
1561- for _ , inner_data in stage_data .items ():
1562- self .vm_alive = check_for_error_string (inner_data )
15631558 self .stop_env ()
15641559 except Exception as e :
15651560 self ._logger .exception ('Error while stop environment: %s' , e )
@@ -1674,7 +1669,7 @@ def __init__(
16741669 self ._tests_dir = CONFIG .tests_base_dir
16751670 self ._ssh_client : Optional [Union [AsyncSSHClient , LongRunSSHClient ]] = None
16761671 self ._vm_ip = None
1677- self ._vm_alive = vm_alive
1672+ self .vm_alive = vm_alive
16781673 self .start_env_failed = False
16791674
16801675 def _wait_for_ssh (self , retries = 60 ):
@@ -1762,6 +1757,8 @@ def start_env(self):
17621757 final_exit_code = exit_code or ssh_exit_code
17631758 final_stdout = f'{ stdout } \n \n { ssh_stdout } '
17641759 final_stderr = f'{ stderr } \n \n { ssh_stderr } '
1760+ if not self .vm_alive :
1761+ self .vm_alive = check_for_error_string (final_stderr )
17651762 return final_exit_code , final_stdout , final_stderr
17661763
17671764 def setup (self , skip_provision : bool = False ):
0 commit comments