diff options
author | unknown <msvensson@neptunus.(none)> | 2006-02-15 22:46:16 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2006-02-15 22:46:16 +0100 |
commit | 3e17193aa341f3a88d98aded5f1898ca6c230911 (patch) | |
tree | 96319625dc31da13e3eedc7ba836270c88d76ec5 /mysql-test/t/ndb_cache_multi2.test | |
parent | 8c1c10dc20c471d349ddd08e566efd63d44d825e (diff) | |
download | mariadb-git-3e17193aa341f3a88d98aded5f1898ca6c230911.tar.gz |
Bug#16795 ndb_cache_multi2
- remove timing dependent part of test, wait until condition occurs or sleep max 10 seconds
mysql-test/r/ndb_cache_multi2.result:
Update test results
mysql-test/t/ndb_cache_multi2.test:
Convert long sleeps to a while leep whith small sleeps and a check if condition has occured.
This allows slower machines to sleep longer if needed.
Diffstat (limited to 'mysql-test/t/ndb_cache_multi2.test')
-rw-r--r-- | mysql-test/t/ndb_cache_multi2.test | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/mysql-test/t/ndb_cache_multi2.test b/mysql-test/t/ndb_cache_multi2.test index 9352505649c..5a78380097e 100644 --- a/mysql-test/t/ndb_cache_multi2.test +++ b/mysql-test/t/ndb_cache_multi2.test @@ -24,10 +24,6 @@ set GLOBAL ndb_cache_check_time=1; reset query cache; flush status; -# Sleep so that the query cache check thread has time to start -sleep 15; - - # Create test tables in NDB and load them into cache # on server1 connection server1; @@ -53,19 +49,34 @@ show status like "Qcache_inserts"; show status like "Qcache_hits"; update t1 set a=3 where a=2; -# Sleep so that the query cache check thread has time to run -sleep 5; - # Connect to server1 and check that cache is invalidated # and correct data is returned connection server1; show status like "Qcache_queries_in_cache"; show status like "Qcache_inserts"; show status like "Qcache_hits"; + +# Loop and wait for max 10 seconds until query cache thread +# has invalidated the cache and the column a in t1 is equal to 3 +let $retries=20; +while (`select a != 3 from t1`) +{ + dec $retries; + if (!$retries) + { + The query_cache thread failed to invalidate query_cache in 10 seconds; + } + sleep 0.5; +} + +# Select from t1 one last time for the result file +# Column a should be 3 select * from t1; + +# There should now be three queries in the cache show status like "Qcache_queries_in_cache"; +# And inserts should be four show status like "Qcache_inserts"; -show status like "Qcache_hits"; drop table t1, t2; |