Re: [Maria-developers] [Commits] Rev 3129: remove few hard-coded checks from mtr in http://bazaar.launchpad.net/~maria-captains/maria/5.1/
![](https://secure.gravatar.com/avatar/99fde0c1dfd216326aae0aff30d493f1.jpg?s=120&d=mm&r=g)
At http://bazaar.launchpad.net/~maria-captains/maria/5.1/
------------------------------------------------------------ revno: 3129 revision-id: sergii@pisem.net-20120124140839-iziwgt30gaalsiw9 parent: sergii@pisem.net-20120124125357-b3o68crdtg2w3fzj committer: Sergei Golubchik
branch nick: 5.1 timestamp: Tue 2012-01-24 15:08:39 +0100 message: remove few hard-coded checks from mtr
Why?!? It's much faster to have the checks in mtr_cases.pm. Otherwise we have to start and stop the mysqld server(s), which is often the major part of time spent in a test case. The test suite is slow enough already ... Also, some of these tests _must_ be in mtr_cases, because just starting the server and executing the test for "skip" causes a failure. Eg. I remember that "not_valgrind" works this way, so I think your change will cause some tests to break in valgrind. If we want to improve things so that we have all checks in one place, I would prefer to move everything into mysql-test-run.pl. In the long term, not just for skipping tests but for everything. There is so much cruft in there just do deal with the testsuite being written partly in perl, partly in SQL (parse warnings...), partly in the mysqltest language, partly in C (mysqltest), ...
- if ( $tinfo->{'not_valgrind'} ) - { - if ( $::opt_valgrind_mysqld ) - { - $tinfo->{'skip'}= 1; - $tinfo->{'comment'}= "Not compatible with Valgrind testing"; - return $tinfo; - } - }
- Kristian
![](https://secure.gravatar.com/avatar/3c2329333dd5898f2e72818af773243d.jpg?s=120&d=mm&r=g)
Hi, Kristian! On Jan 25, Kristian Nielsen wrote:
writes: At http://bazaar.launchpad.net/~maria-captains/maria/5.1/
------------------------------------------------------------ revno: 3129 revision-id: sergii@pisem.net-20120124140839-iziwgt30gaalsiw9 parent: sergii@pisem.net-20120124125357-b3o68crdtg2w3fzj committer: Sergei Golubchik
branch nick: 5.1 timestamp: Tue 2012-01-24 15:08:39 +0100 message: remove few hard-coded checks from mtr Why?!?
This was just a followup. Most hard-coded checks were removed long time ago, these I must've missed. In general, the direction I'm moving in is to remove as much of hard-coded special cases from mtr as possible. If one wants to understand what a test is doing, it should be enough to look at test files (testname.*), studying mtr code should not be required.
It's much faster to have the checks in mtr_cases.pm. Otherwise we have to start and stop the mysqld server(s), which is often the major part of time spent in a test case. The test suite is slow enough already ...
Yes. I plan to address that too. One idea is to cache check results (like, if have_debug.inc failed once, all debug tests will be skipped at once). MDEV-105
Also, some of these tests _must_ be in mtr_cases, because just starting the server and executing the test for "skip" causes a failure. Eg. I remember that "not_valgrind" works this way, so I think your change will cause some tests to break in valgrind.
I tested before committing (with valgrind too), so I hope it'll work. Those tests that have to be in mtr - they are in mtr. For example "rpl" check - it forces mtr to use a different .cnf template (this can be moved out of mtr too, but I didn't bother). Or your code for "long" tests. I only removed hard-coded checks that can be easily removed.
If we want to improve things so that we have all checks in one place, I would prefer to move everything into mysql-test-run.pl. In the long term, not just for skipping tests but for everything. There is so much cruft in there just do deal with the testsuite being written partly in perl, partly in SQL (parse warnings...), partly in the mysqltest language, partly in C (mysqltest), ...
I want to have a clear distinction between a driver program, that run tests, and actual tests. Adding new tests shouldn't require any modifications for the driver. Which doesn't mean we cannot "move everything in mysql-test-run.pl" :) If every test is a perl module, and mtr automatically discovers and loads them as needed - then there will be only one language to deal with and everything will be in mtr. But it's a big incompatible change :( Regards, Sergei
![](https://secure.gravatar.com/avatar/99fde0c1dfd216326aae0aff30d493f1.jpg?s=120&d=mm&r=g)
Sergei Golubchik
In general, the direction I'm moving in is to remove as much of hard-coded special cases from mtr as possible.
Sure, but these extra checks for skip in mtr_cases are not hard-coded special cases, they are optimisations to speed up the suite. They don't change semantics, they just make things faster by avoiding unnecessary server restarts. Please let's keep them (and lets add more as needed).
Yes. I plan to address that too. One idea is to cache check results (like, if have_debug.inc failed once, all debug tests will be skipped at once). MDEV-105
Well, then let's wait with removing the optimisations until this is implemented ... ?
Which doesn't mean we cannot "move everything in mysql-test-run.pl" :) If every test is a perl module, and mtr automatically discovers and loads them as needed - then there will be only one language to deal with and everything will be in mtr.
But it's a big incompatible change :(
Not incompatible - the idea would be to replace the `mysqltest` interpreter with Perl code that runs inside mysql-test-run. Test cases would remain identical (though we could then clean them up a lot). Anyway, this is not something we would want to do while we're still merging from MySQL@Oracle - if ever ... - Kristian.
participants (2)
-
Kristian Nielsen
-
Sergei Golubchik