Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Commit

Permalink
backend: fix unit test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Feb 20, 2020
1 parent bc9d479 commit 4ce165c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions lightning/backend/tikv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"net/http"
"net/http/httptest"
"net/url"
"sort"
"sync"

Expand Down Expand Up @@ -75,16 +74,13 @@ func (s *tikvSuite) TestForAllStores(c *C) {
}))
defer server.Close()

serverURL, err := url.Parse(server.URL)
c.Assert(err, IsNil)

ctx := context.Background()
var (
allStoresLock sync.Mutex
allStores []*kv.Store
)
tls := common.NewTLSFromMockServer(server)
err = kv.ForAllStores(ctx, tls, kv.StoreStateDown, func(c2 context.Context, store *kv.Store) error {
err := kv.ForAllStores(ctx, tls, kv.StoreStateDown, func(c2 context.Context, store *kv.Store) error {
allStoresLock.Lock()
allStores = append(allStores, store)
allStoresLock.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion lightning/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (s *configTestSuite) TestLoadConfig(c *C) {
taskCfg.Checkpoint.Driver = config.CheckpointDriverMySQL
err = taskCfg.Adjust()
c.Assert(err, IsNil)
c.Assert(taskCfg.Checkpoint.DSN, Equals, "guest:12345@tcp(172.16.30.11:4001)/?charset=utf8&sql_mode='"+mysql.DefaultSQLMode+"'&maxAllowedPacket=67108864&tls=preferred")
c.Assert(taskCfg.Checkpoint.DSN, Equals, "guest:12345@tcp(172.16.30.11:4001)/?charset=utf8&sql_mode='"+mysql.DefaultSQLMode+"'&maxAllowedPacket=67108864&tls=false")

result := taskCfg.String()
c.Assert(result, Matches, `.*"pd-addr":"172.16.30.11:2379,172.16.30.12:2379".*`)
Expand Down

0 comments on commit 4ce165c

Please sign in to comment.