зеркало из https://github.com/github/vitess-gh.git
Fixing this test to work with grpc.
This commit is contained in:
Родитель
bcb1647b49
Коммит
067bbcbb9a
|
@ -18,6 +18,7 @@ from multiprocessing.pool import ThreadPool
|
||||||
import environment
|
import environment
|
||||||
import tablet
|
import tablet
|
||||||
import utils
|
import utils
|
||||||
|
from protocols_flavor import protocols_flavor
|
||||||
|
|
||||||
from net import gorpc
|
from net import gorpc
|
||||||
from vtdb import keyrange
|
from vtdb import keyrange
|
||||||
|
@ -1021,12 +1022,15 @@ class TestFailures(unittest.TestCase):
|
||||||
self.replica_tablet.wait_for_vttablet_state('SERVING')
|
self.replica_tablet.wait_for_vttablet_state('SERVING')
|
||||||
# TODO: expect to fail until we can detect vttablet shuts down gracefully
|
# TODO: expect to fail until we can detect vttablet shuts down gracefully
|
||||||
# while VTGate is idle.
|
# while VTGate is idle.
|
||||||
|
# NOTE: with grpc, it will reconnect, and not trigger an error.
|
||||||
|
if protocols_flavor().tabletconn_protocol() == 'grpc':
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
vtgate_conn._execute(
|
result = vtgate_conn._execute(
|
||||||
"select 1 from vt_insert_test", {},
|
"select 1 from vt_insert_test", {},
|
||||||
KEYSPACE_NAME, 'replica',
|
KEYSPACE_NAME, 'replica',
|
||||||
keyranges=[self.keyrange])
|
keyranges=[self.keyrange])
|
||||||
self.fail("DatabaseError should have been raised")
|
self.fail("DatabaseError should have been raised, but got %s" % str(result))
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.assertIsInstance(e, dbexceptions.DatabaseError)
|
self.assertIsInstance(e, dbexceptions.DatabaseError)
|
||||||
self.assertNotIsInstance(e, dbexceptions.IntegrityError)
|
self.assertNotIsInstance(e, dbexceptions.IntegrityError)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче