func (tk *CTestKit) OpenSession(ctx context.Context) context.Context {
	if getSession(ctx) == nil {
		se, err := session.CreateSession4Test(tk.store)
		tk.c.Assert(err, check.IsNil)
		id := atomic.AddUint64(&connectionID, 1)
		se.SetConnectionID(id)
		ctx = setSession(ctx, se)
	}
	return ctx
}
OpenSession opens new session ctx if no exists one.
package testkit
import (
	"context"
	"math/rand"
	"sync/atomic"
	"github.com/pingcap/check"
	"github.com/pingcap/errors"
	"github.com/pingcap/tidb/kv"
	"github.com/pingcap/tidb/session"
	"github.com/pingcap/tidb/types"
	"github.com/pingcap/tidb/util"
	"github.com/pingcap/tidb/util/sqlexec"
)
type sessionCtxKeyType struct{}
var sessionKey = sessionCtxKeyType{}
func getSession(ctx context.Context) session.Session {
	s := ctx.Value(sessionKey)
	if s == nil {
		return nil
	}
	return s.(session.Session)
}
func setSession(ctx context.Context, se session.Session) context.Context {
	return context.WithValue(ctx, sessionKey, se)
}
type CTestKit struct {
	c     *check.C
	store kv.Storage
}
func NewCTestKit(c *check.C, store kv.Storage) *CTestKit {
	return &CTestKit{
		c:     c,
		store: store,
	}
}