Пример #1
0
 def test_retry_txn_pool_full(self):
   master_conn = vtdb_test.get_master_connection()
   master_conn._execute("set vt_transaction_cap=1", {})
   master_conn.begin()
   master_conn2 = vtdb_test.get_master_connection()
   master_conn2.begin()
   master_conn.commit()
   master_conn._execute("set vt_transaction_cap=20", {})
   master_conn.begin()
   master_conn._execute("delete from vt_insert_test", {})
   master_conn.commit()
Пример #2
0
 def test_tablet_fail_write(self):
   try:
     master_conn = vtdb_test.get_master_connection()
   except Exception, e:
     self.fail("Connection to shard0 master failed with error %s" % str(e))
Пример #3
0
      master_conn.commit()
    proc = self.master_tablet.start_vttablet()
    master_conn.begin()
    master_conn._execute("delete from vt_insert_test", {})
    master_conn.commit()

  def test_query_timeout(self):
    try:
      replica_conn = vtdb_test.get_replica_connection(shard_index=self.shard_index)
    except Exception, e:
      self.fail("Connection to shard0 replica failed with error %s" % str(e))
    with self.assertRaises(dbexceptions.TimeoutError):
      replica_conn._execute("select sleep(12) from dual", {})

    try:
      master_conn = vtdb_test.get_master_connection()
    except Exception, e:
      self.fail("Connection to shard0 master failed with error %s" % str(e))
    with self.assertRaises(dbexceptions.TimeoutError):
      master_conn._execute("select sleep(12) from dual", {})

  # FIXME(shrutip): flaky test, making it NOP for now
  def test_restart_mysql_failure(self):
    return
    try:
      replica_conn = vtdb_test.get_replica_connection(shard_index=self.shard_index)
    except Exception, e:
      self.fail("Connection to shard0 replica failed with error %s" % str(e))
    utils.wait_procs([self.replica_tablet.shutdown_mysql(),])
    with self.assertRaises(dbexceptions.DatabaseError):
      replica_conn._execute("select 1 from vt_insert_test", {})