From eb1cc3da5eceb2a1d7e501f33e108a7316700af4 Mon Sep 17 00:00:00 2001 From: Baron Schwartz Date: Sun, 3 Jun 2012 22:18:44 -0400 Subject: [PATCH] fix nondeterministic wait_for_master test --- t/lib/MasterSlave.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/lib/MasterSlave.t b/t/lib/MasterSlave.t index 334a400b..d5d37af8 100644 --- a/t/lib/MasterSlave.t +++ b/t/lib/MasterSlave.t @@ -336,8 +336,12 @@ $res = $ms->wait_for_master( ok($res->{result} >= 0, 'Wait was successful'); $ms->stop_slave($slaves[0]); -$dbh->do('drop database if exists test'); # Any stmt will do -diag(`(sleep 3; echo "start slave" | /tmp/$port_for{slave0}/use)&`); +$dbh->do('drop database if exists test'); +$dbh->do('create database test'); +$dbh->do('create table test.t(a int)'); +$dbh->do('insert into test.t(a) values(1)'); +$dbh->do('update test.t set a=sleep(5)'); +diag(`(/tmp/$port_for{slave0}/use -e 'start slave')&`); eval { $res = $ms->wait_for_master( master_status => $ms->get_master_status($dbh),