diff options
author | Nuno Carvalho <nuno.carvalho@oracle.com> | 2012-01-23 16:50:54 +0000 |
---|---|---|
committer | Nuno Carvalho <nuno.carvalho@oracle.com> | 2012-01-23 16:50:54 +0000 |
commit | 825c74f6aa5bdeb1d041846df3f592714dd741bb (patch) | |
tree | d1d0b747273fd4628dea4f200b4e9cbb7973e3f7 /mysql-test | |
parent | e69da6dc3e0026ab03786a290c45305866d7fab0 (diff) | |
download | mariadb-git-825c74f6aa5bdeb1d041846df3f592714dd741bb.tar.gz |
BUG#12364404 - UNDETERMINISTIC WAIT LOOP IN WAIT_FOR_NDB_TO_BINLOG.INC
The wait_for_ndb_to_binlog.inc include file used by the blow rpl_tests
common for rpl and rpl_ndb suite is simply doing a "sleep 5", this is
not deterministic and wastes lot of test time uneccessarily. The test
should be rewritten to check if the condition it wait for has been
reached or not.
For NDB engine all events will be added by NDB injector so tests only
can continue after injector is ready, this test waits for proper
injector thread state.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/include/wait_for_ndb_to_binlog.inc | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/mysql-test/include/wait_for_ndb_to_binlog.inc b/mysql-test/include/wait_for_ndb_to_binlog.inc index 77da6d62154..c1f94802724 100644 --- a/mysql-test/include/wait_for_ndb_to_binlog.inc +++ b/mysql-test/include/wait_for_ndb_to_binlog.inc @@ -1,13 +1,11 @@ # ==== Purpose ==== # -# Several test primitives from mysql-test/extra/rpl_tests -# shared for test cases for MyISAM, InnoDB, NDB and other -# engines. But for NDB all events will be added by NDB -# injector and now there are no way to detect the state of -# NDB injector therefore this primitive waits 5 sec -# if engine type is NDB. -# In future that should be fixed by waiting of proper -# state of NDB injector. +# Several test primitives from mysql-test/extra/rpl_tests +# are shared for test cases for MyISAM, InnoDB, NDB and +# other engines. +# For NDB engine all events will be added by NDB injector +# so tests only can continue after injector is ready, +# this test waits for proper injector thread state. # # ==== Usage ==== # @@ -17,25 +15,12 @@ # ==== Parameters ===== # # $engine_type -# Type of engine. If type is NDB then it waits $wait_time sec -# -# $wait_time -# Test will wait $wait_time seconds - -let $_wait_time= 5; - -if (!$wait_time) { - let $_wait_time= $wait_time; -} +# Type of engine. If type is NDB then it waits for injector +# thread proper state. if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) { - while (!$_wait_time) { - let $_wait_time_internal= 10; - while (!$_wait_time_internal) { - sleep 0.1; - dec $_wait_time_internal; - } - dec $_wait_time; - } + let $show_statement= SHOW PROCESSLIST; + let $field= State; + let $condition= = 'Waiting for event from ndbcluster'; + source include/wait_show_condition.inc; } - |