Documentation Home
MySQL Internals Manual

MySQL Internals Manual  /  ...  /  Perfect Cleanup at the End of a Test

26.3.3 Perfect Cleanup at the End of a Test

  • Cleaning up becomes much more comfortable and less error prone if you create your "own" database and create all tables there. At the end of the test, you need to drop just this database.

  • Do not forget to remove all users you created and all permissions you granted. Otherwise the next test might fail when checking grants in general.

  • Close all connections which you have explicitly created and please ensure that the disconnect is finished = the sessions are no more visible within the processlist.

  • Remove all auxiliary files created within your test.

MTR2 runs now by default with "check-testcases" enabled. It checks if there are additional objects like user or tables, modifed system table etc. "check-testcases" will be soon improved. However, proper cleanup should still be a responsibility of both the test author and reviewer.