Bug #43365 | mysql-test: hook for adding calls to run after test is finished | ||
---|---|---|---|
Submitted: | 4 Mar 2009 11:13 | Modified: | 10 Nov 2009 19:38 |
Reporter: | Jørgen Austvik | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | Tools: MTR / mysql-test-run | Severity: | S4 (Feature request) |
Version: | OS: | Any | |
Assigned to: | Bjørn Munch | CPU Architecture: | Any |
[4 Mar 2009 11:13]
Jørgen Austvik
[18 Mar 2009 12:48]
Matthias Leich
Hi, I propose a different solution. Background: 1. Lets assume we are around the end of the execution of a test script. If we are able to detect that we are running in "stress" mode or not (= MTR was started with or without "--stress") by using the existing mysqltest language and/or SQL and the environment (content of env variables or files) than we could adjust our cleanup actions - running in "stress" mode -> do nothing - running not in "stress" mode -> do the cleanup 2. All stress testing related actions already happen under the control of MTR and partially the scripts. Therefore I think the necessary changes should happen within MTR and the scripts. The mysqltest application should be kept simple if possible. Possible solution: 1. In MTR MTR sets and exports an environment variable with a name like MTR_STRESS which shows if we are running in stress mode before any mysqltest process is started. 2. Within the test if (`SELECT '$MTR_STRESS' <> '1') { --source <some path>/<name>_cleanup.test }
[18 Nov 2009 11:23]
Bjørn Munch
I wasn't aware of this bug intil it got assigned to be now. I'm not quite sure what the actual problem is that one tries to solve here. There is already a way to avoid the failure reported by MTR due to changes in schema etc.: call mtr.force_restart(); This will cause a server restart after the testcase and thus avoid the test. Would this solve the problem?