Category: RandomQueryGenerator

RandomQueryGeneratorIntegration


[edit] Using the Random Query Generator with MTRv2 - mysql-test-run.pl

MTRv2 provides the capability to start a server and then run an external script against it, in this case, the RQG. A sample .test file looks like this:

--disable-query-log
if (`select '$RQG_HOME'=`)
{
  --skip Could not locate RQG - set RQG_HOME variable.
}
 
--exec perl $RQG_HOME/gentest.pl --dsn=dbi:mysql:host=127.0.0.1:port=$MASTER_MYPORT:user=root:database=test --grammar=$RQG_HOME/conf/example.yy > $MYSQL_TMP_DIR/rqg.out 2>&1

DROP DATABASE test;
CREATE DATABASE test;
--exit

Unless RQG_HOME is set, the test will be skipped. Otherwise, an RQG scenario will run against the server that has already been stated by MTR. Since the output of a concurrent RQG run is not deterministic, we pipe it to a temporary file. If you want RQG output to be displayed on your std.out along with other MTR output, use --system instead of --exec and remove the redirection part of the command.

The final statements recreate an empty test database so that MTRv2 does not complain that the test had side effects and did not clean up properly.

NOTE that if the statements generated by the RQG may result in warnings being printed to the server's error log, and you want to accept such warnings as being valid, you may need to add the option --nowarnings to your MTR command line (depending on which version of MTR you use). Otherwise MTR will check the error log after the test and proclaim failure if warnings (such as deadlocks) are found.

[edit] Using RQG with PushBuild2

More information is available here [1] (authorization required)

Retrieved from "http://forge.mysql.com/wiki/RandomQueryGeneratorIntegration"

This page has been accessed 1,989 times. This page was last modified 22:05, 24 January 2011.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...