# Suite Teardown stop on keyword error

**URL:** <https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180>\
**Category:** Robot Framework\
**Created:** [31 January 2022 16:13 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180 "2022-01-31T16:13:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Max](https://forum.robotframework.org/u/Max)\
**Post date:** [31 January 2022 16:13 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/1 "2022-01-31T16:13:01Z")

</div>

Hello,

I’m facing an issue on Suite Teardown. From what I read in the documentation, the teardown should always been run.

But I just discover than, in case of keyword issue (not a test failure) it is not the case. Here a simple example inspired from my test suite:

```python
***Settings***

Suite Setup Setup
Suite Teardown Release

Force Tags robot:recursive-continue-on-failure
Default Tags all

***Test Cases***

Test1
    Log test1

***Keywords***
Setup
    Log setup

Release
    SubRelease
    Log Release 4

SubRelease
    Log release 1
    Set Test variable ${toto} 4
    Log Release 3

```

Here the result  
[![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/f/fe99683212122b121be192fdce38b19ae87575c1.png)](https://user-images.githubusercontent.com/97884384/150753442-011e5e4f-4515-471a-afd7-afc6b904a74c.png)

I know that do a Set Test variable in a teardown is a mistake but still, teardown should not continue ? Or did I missed something ?

Thank you.  
Best regards,  
Max

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [31 January 2022 17:46 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/2 "2022-01-31T17:46:15Z")

</div>

I “think” that keyword errors are critical, that is why it Fails.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [31 January 2022 23:59 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/3 "2022-01-31T23:59:57Z")

</div>

> [@Max](#):
>
> I know that do a Set Test variable in a teardown is a mistake but still, teardown should not continue ? Or did I missed something ?

![Screen Shot 2022-02-01 at 9.53.12 am](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/c/c3caf400ebcdc1b4520ea7f309be44aba7be4d70.png)

If you are asking why these 2 keywords ran? they didn’t Grey is “SKIP” status [3.2.2 Test and suite statuses](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#toc-entry-419)

Does that answer your question or did I miss understand?

Dave.

---

<div class="post-metadata">

**Author:** ![Max](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Max](https://forum.robotframework.org/u/Max)\
**Post date:** [1 February 2022 07:42 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/4 "2022-02-01T07:42:05Z")

</div>

> [@damies13](#):
>
> keywords

I’m asking “why they did NOT ran?” =\> Teardown shall be considered as “Continue if failure” but in that case, it is not. Are we agreed that’s a bug ?

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [1 February 2022 07:49 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/5 "2022-02-01T07:49:18Z")

</div>

Thats beyond my knowledge of Robot Framework, sorry I’m not a Robot Framework developer. Maybe someone else can step in and answer?

---

<div class="post-metadata">

**Author:** ![robinmackaij](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/robinmackaij/32/126_2.png) [@robinmackaij](https://forum.robotframework.org/u/robinmackaij)\
**Post date:** [2 February 2022 17:55 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/6 "2022-02-02T17:55:05Z")

</div>

It’s not a bug but according to design and documentation. The reserved tags continue-on-failure and recursive-continue-on-failure apply to Test Cases. The Suite Setup and Suite Teardown are not part of the Test Case scope. I’m not entirely sure if Test Setup and Test Teardown are considered in the Test Case scope, I would guess not.

I believe being able to use robot:continue-on-failure at a keyword level was discussed at some point, but it raises my issues that can lead to conflicting behavior.

---

<div class="post-metadata">

**Author:** ![Max](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Max](https://forum.robotframework.org/u/Max)\
**Post date:** [2 February 2022 19:54 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/7 "2022-02-02T19:54:45Z")

</div>

It shall be the case, here an extract of the user manual :

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/7/72cbc55b0d6510d21082ada57cddf89ed21163f1.png)

---

<div class="post-metadata">

**Author:** ![robinmackaij](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/robinmackaij/32/126_2.png) [@robinmackaij](https://forum.robotframework.org/u/robinmackaij)\
**Post date:** [3 February 2022 08:28 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/8 "2022-02-03T08:28:39Z")

</div>

Helio is correct, it’s the difference between a keyword failure and an error. If `Set Test variable ${toto} 4` is changed to `Fail` (= regular keyword failure), `Log Release 3` and `Log Release 4` are executed as expected. If it’s changed to `Fatal Error`, we get the result you’re seeing.

While this could be more clear in the documentation, I understand why this difference is there; if a `Fatal Error` occurs, that’s a hard override the regular flow…trying to continue should be considered pointless at that point. This allows us to abort a Teardown, if needed / desired, which would be impossible if any error / failure was ignored during Teardown.

---

<div class="post-metadata">

**Author:** ![Max](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Max](https://forum.robotframework.org/u/Max)\
**Post date:** [3 February 2022 09:44 UTC](https://forum.robotframework.org/t/suite-teardown-stop-on-keyword-error/3180/9 "2022-02-03T09:44:52Z")

</div>

> [@robinmackaij](#):
>
> would

Ok got it, thx !
