зеркало из https://github.com/github/vitess-gh.git
Merge branch 'master' into monitoring
This commit is contained in:
Коммит
332b0e9da1
|
@ -46,6 +46,7 @@ ln -snf $VTTOP/config $VTROOT/config
|
|||
ln -snf $VTTOP/data $VTROOT/data
|
||||
ln -snf $VTTOP/py $VTROOT/py-vtdb
|
||||
ln -snf $VTTOP/go/zk/zkctl/zksrv.sh $VTROOT/bin/zksrv.sh
|
||||
ln -snf $VTTOP/test/vthook-test.sh $VTROOT/vthook/test.sh
|
||||
|
||||
# install mysql
|
||||
if [ -d $VTROOT/dist/mysql ];
|
||||
|
|
|
@ -4,6 +4,8 @@ import framework
|
|||
import cache_cases1
|
||||
import cache_cases2
|
||||
|
||||
import test_env
|
||||
|
||||
class TestWillNotBeCached(framework.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
@ -97,12 +99,12 @@ class TestCache(framework.TestCase):
|
|||
|
||||
def test_overrides(self):
|
||||
tstart = self.env.table_stats()["vtocc_view"]
|
||||
with self.env.querylogs() as querylog:
|
||||
with test_env.Querylog(self.env) as querylog:
|
||||
cu = self.env.execute("select * from vtocc_view where key2 = 1")
|
||||
self.assertEqual(cu.fetchone(), (1L, 10L, 1L, 3L))
|
||||
tend = self.env.table_stats()["vtocc_view"]
|
||||
self.assertEqual(tstart["Misses"]+1, tend["Misses"])
|
||||
log = querylog.read()
|
||||
log = querylog.tailer.read()
|
||||
|
||||
self.assertContains(log, "select * from vtocc_view where 1 != 1")
|
||||
self.assertContains(log, "select key2, key1, data1, data2 from vtocc_view where key2 = 1")
|
||||
|
@ -115,19 +117,19 @@ class TestCache(framework.TestCase):
|
|||
|
||||
tstart = self.env.table_stats()["vtocc_view"]
|
||||
self.env.conn.begin()
|
||||
with self.env.querylogs() as querylog:
|
||||
with test_env.Querylog(self.env) as querylog:
|
||||
self.env.execute("update vtocc_part1 set data1 = 2 where key2 = 1")
|
||||
log = querylog.read()
|
||||
log = querylog.tailer.read()
|
||||
self.env.conn.commit()
|
||||
self.assertContains(log, "update vtocc_part1 set data1 = 2 where key2 = 1 /* _stream vtocc_part1 (key2 ) (1 ); */")
|
||||
|
||||
|
||||
with self.env.querylogs() as querylog:
|
||||
with test_env.Querylog(self.env) as querylog:
|
||||
cu = self.env.execute("select * from vtocc_view where key2 = 1")
|
||||
self.assertEqual(cu.fetchone(), (1L, 10L, 2L, 3L))
|
||||
tend = self.env.table_stats()["vtocc_view"]
|
||||
self.assertEqual(tstart["Misses"]+1, tend["Misses"])
|
||||
log = querylog.read()
|
||||
log = querylog.tailer.read()
|
||||
self.assertContains(log, "select key2, key1, data1, data2 from vtocc_view where key2 = 1")
|
||||
|
||||
tstart = self.env.table_stats()["vtocc_view"]
|
||||
|
@ -142,12 +144,12 @@ class TestCache(framework.TestCase):
|
|||
self.env.conn.commit()
|
||||
|
||||
|
||||
with self.env.querylogs() as querylog:
|
||||
with test_env.Querylog(self.env) as querylog:
|
||||
cu = self.env.execute("select * from vtocc_view where key2 = 1")
|
||||
self.assertEqual(cu.fetchone(), (1L, 10L, 2L, 2L))
|
||||
tend = self.env.table_stats()["vtocc_view"]
|
||||
self.assertEqual(tstart["Misses"]+1, tend["Misses"])
|
||||
log = querylog.read()
|
||||
log = querylog.tailer.read()
|
||||
self.assertContains(log, "select key2, key1, data1, data2 from vtocc_view where key2 = 1")
|
||||
|
||||
tstart = self.env.table_stats()["vtocc_view"]
|
||||
|
|
|
@ -347,7 +347,7 @@ class VtoccTestEnv(TestEnv):
|
|||
|
||||
if self.sensitive_mode:
|
||||
occ_args.extend(['-queryserver-config-sensitive-mode'])
|
||||
self.vtocc = subprocess.Popen(occ_args, stdout=self.vtstdout, stderr=self.vtstderr)
|
||||
self.vtocc = subprocess.Popen(occ_args, stdout=utils.devnull, stderr=utils.devnull)
|
||||
for i in range(30):
|
||||
try:
|
||||
self.conn = self.connect()
|
||||
|
|
Загрузка…
Ссылка в новой задаче