#NEWLINE# def test_handle_task_error( worker , submit_job ) : #NEWLINE# #INDENT# with Job ( 'Job' ) as job : #NEWLINE# #INDENT# with Task ( title = 'Task' ) : #NEWLINE# #INDENT# Action ( cmd = 'fakecmd' , _role = 'shell' ) #NEWLINE# Action ( cmd = 'echo "an error occurred"' , _role = 'shell' , _whenerror = True ) #NEWLINE# #UNINDENT# #UNINDENT# ( workflow_id , run_id ) = submit_job ( job ) #NEWLINE# while ( not is_job_done ( workflow_id , run_id ) ) : #NEWLINE# #INDENT# print ( 'wait' ) #NEWLINE# time . sleep ( 3 ) #NEWLINE# #UNINDENT# assert ( get_close_status ( submit_job , run_id ) == 'FAILED' )