Add clean up in "always" phase of the block

Because our tests use --retry-on-error, and the first thing the test
does is to try to create the database. We must cleanup otherwise if
there is a retry, it will throw a misleading "database already exists"
error.
This commit is contained in:
Laurent Indermuehle 2023-01-20 18:19:29 +01:00
parent d6956e236e
commit e412aa5142
No known key found for this signature in database
GPG key ID: 93FA944C9F34DD09

View file

@ -390,3 +390,10 @@
that: that:
- result is changed - result is changed
- result.executed_queries == ['DROP DATABASE {{ test_db }}'] - result.executed_queries == ['DROP DATABASE {{ test_db }}']
always:
- name: Clean up test_db
mysql_query:
<<: *mysql_params
query: 'DROP DATABASE IF EXISTS {{ test_db }}'