Skip to content

Commit

Permalink
store/tikv: enable test. (pingcap#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
disksing authored and shenli committed Nov 28, 2016
1 parent 0348130 commit c4d3d5d
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions store/tikv/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/pingcap/kvproto/pkg/kvrpcpb"
"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/pd/pd-client"
"github.com/pingcap/tidb"
"github.com/pingcap/tidb/store/tikv/mock-tikv"
"github.com/pingcap/tidb/store/tikv/oracle"
"golang.org/x/net/context"
Expand Down Expand Up @@ -126,36 +127,35 @@ func (s *testStoreSuite) TestBusyServerKV(c *C) {
wg.Wait()
}

// TODO: Deal with this test.
//func (s *testStoreSuite) TestBusyServerCop(c *C) {
// client := newBusyClient(s.store.client)
// s.store.client = client
//
// session, err := tidb.CreateSession(s.store)
// c.Assert(err, IsNil)
//
// var wg sync.WaitGroup
// wg.Add(2)
//
// client.setBusy(true)
// go func() {
// defer wg.Done()
// time.Sleep(time.Millisecond * 100)
// client.setBusy(false)
// }()
//
// go func() {
// defer wg.Done()
// rs, err := session.Execute(`SELECT variable_value FROM mysql.tidb WHERE variable_name="bootstrapped"`)
// c.Assert(err, IsNil)
// row, err := rs[0].Next()
// c.Assert(err, IsNil)
// c.Assert(row, NotNil)
// c.Assert(row.Data[0].GetString(), Equals, "True")
// }()
//
// wg.Wait()
//}
func (s *testStoreSuite) TestBusyServerCop(c *C) {
client := newBusyClient(s.store.client)
s.store.client = client

session, err := tidb.CreateSession(s.store)
c.Assert(err, IsNil)

var wg sync.WaitGroup
wg.Add(2)

client.setBusy(true)
go func() {
defer wg.Done()
time.Sleep(time.Millisecond * 100)
client.setBusy(false)
}()

go func() {
defer wg.Done()
rs, err := session.Execute(`SELECT variable_value FROM mysql.tidb WHERE variable_name="bootstrapped"`)
c.Assert(err, IsNil)
row, err := rs[0].Next()
c.Assert(err, IsNil)
c.Assert(row, NotNil)
c.Assert(row.Data[0].GetString(), Equals, "True")
}()

wg.Wait()
}

var errStopped = errors.New("stopped")

Expand Down

0 comments on commit c4d3d5d

Please sign in to comment.