From 067bbcbb9a50b3c46fa296c6b5cd39d69673a0e5 Mon Sep 17 00:00:00 2001 From: Alain Jobart Date: Fri, 7 Aug 2015 12:00:08 -0700 Subject: [PATCH] Fixing this test to work with grpc. --- test/vtgatev2_test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/vtgatev2_test.py b/test/vtgatev2_test.py index ca2ec0b20c..8377725e04 100755 --- a/test/vtgatev2_test.py +++ b/test/vtgatev2_test.py @@ -18,6 +18,7 @@ from multiprocessing.pool import ThreadPool import environment import tablet import utils +from protocols_flavor import protocols_flavor from net import gorpc from vtdb import keyrange @@ -1021,12 +1022,15 @@ class TestFailures(unittest.TestCase): self.replica_tablet.wait_for_vttablet_state('SERVING') # TODO: expect to fail until we can detect vttablet shuts down gracefully # while VTGate is idle. + # NOTE: with grpc, it will reconnect, and not trigger an error. + if protocols_flavor().tabletconn_protocol() == 'grpc': + return try: - vtgate_conn._execute( + result = vtgate_conn._execute( "select 1 from vt_insert_test", {}, KEYSPACE_NAME, 'replica', 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: self.assertIsInstance(e, dbexceptions.DatabaseError) self.assertNotIsInstance(e, dbexceptions.IntegrityError)