Table of Contents
- 26.1 Formal Stuff
- 26.2 Comments Everywhere
- 26.3 Some Rules Outside of the Formal Stuff
- 26.4 Negative Tests
- 26.5 Tests with Several Variants
- 26.6 Miscellaneous Tips
- 26.6.1 Stability Checks for Random Timing Problems
- 26.6.2 Stability Checks for Hostname-Related Problems
- 26.6.3 Stability Checks for Unexpected Problems
- 26.6.4 Row Order Within Result Sets
- 26.6.5 Test Case Behavior Should Depend on the Result of a SHOW
- 26.6.6 Does a Test Execution Hang?
- 26.6.7 If Your Test is Complicated, Support Debugging
- 26.6.8 You Need to Know Some Syntax, an Option, Etc., but Hate Reading Manuals
- 26.7 Notes on MTR2
- 26.8 Examples of Suspicious Tests and Scripts
There are a lot of strict rules and rules of thumb which may increase the quality of tests written for the tool pair mysqltest/mysqltest-run.pl (MTR). The following presentation should give you some hints.
This document should not replace reading our documentation about testing. See the Writing Test Cases section of the MySQL Server Doxygen documentation, available at https://dev.mysql.com/doc/index-other.html.
Some of the examples might not work
with MTR1 or
on some operating system.
MTR2 means the second version of mysql-test-run.pl/mysqltest. MTR2 replaced MTR1 ~ Jan 2009 in MySQL 5.1 and 6.0.
The term "protocol" means in most cases "output from a test case."
October 2007 - Matthias Leich - Create this document for a MySQL University session
March 2009 - Matthias Leich - Updates and corrections, add "Examples of suspicious scripts"
March 2009 - Patrick Crews - Corrections, add "Notes on MTR"