示例#1
0
func testPrepareError(t *testing.T, conn tabletconn.TabletConn, f *FakeQueryService) {
	t.Log("testPrepareError")
	f.HasError = true
	testErrorHelper(t, f, "Prepare", func(ctx context.Context) error {
		return conn.Prepare(ctx, TestTarget, CommitTransactionID, Dtid)
	})
	f.HasError = false
}
示例#2
0
func testPrepare(t *testing.T, conn tabletconn.TabletConn, f *FakeQueryService) {
	t.Log("testPrepare")
	ctx := context.Background()
	ctx = callerid.NewContext(ctx, TestCallerID, TestVTGateCallerID)
	err := conn.Prepare(ctx, TestTarget, CommitTransactionID, Dtid)
	if err != nil {
		t.Fatalf("Prepare failed: %v", err)
	}
}
示例#3
0
func testPreparePanics(t *testing.T, conn tabletconn.TabletConn, f *FakeQueryService) {
	t.Log("testPreparePanics")
	testPanicHelper(t, f, "Prepare", func(ctx context.Context) error {
		return conn.Prepare(ctx, TestTarget, CommitTransactionID, Dtid)
	})
}