Skip to content

Commit

Permalink
*: replace github.com/etcd-io/gofail with the forked one (#8693) (#8751)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored and jackysp committed Dec 19, 2018
1 parent c06df05 commit 0c7ca13
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 30 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ explaintest: server
@cd cmd/explaintest && ./run-tests.sh -s ../../bin/tidb-server

gotest:
$(GO) get github.com/etcd-io/gofail
@rm -rf $GOPATH/bin/gofail
$(GO) get github.com/pingcap/gofail
@which gofail
@$(GOFAIL_ENABLE)
ifeq ("$(TRAVIS_COVERAGE)", "1")
@echo "Running in TRAVIS_COVERAGE mode."
Expand All @@ -126,21 +128,21 @@ endif
@$(GOFAIL_DISABLE)

race:
$(GO) get github.com/etcd-io/gofail
$(GO) get github.com/pingcap/gofail
@$(GOFAIL_ENABLE)
@export log_level=debug; \
$(GOTEST) -timeout 20m -race $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
@$(GOFAIL_DISABLE)

leak:
$(GO) get github.com/etcd-io/gofail
$(GO) get github.com/pingcap/gofail
@$(GOFAIL_ENABLE)
@export log_level=debug; \
$(GOTEST) -tags leak $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
@$(GOFAIL_DISABLE)

tikv_integration_test:
$(GO) get github.com/etcd-io/gofail
$(GO) get github.com/pingcap/gofail
@$(GOFAIL_ENABLE)
$(GOTEST) ./store/tikv/. -with-tikv=true || { $(GOFAIL_DISABLE); exit 1; }
@$(GOFAIL_DISABLE)
Expand Down
2 changes: 1 addition & 1 deletion ddl/fail_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"fmt"
"time"

gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/parser"
"github.com/pingcap/parser/model"
"github.com/pingcap/tidb/ddl"
Expand Down
2 changes: 1 addition & 1 deletion ddl/fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
package ddl

import (
gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/parser/ast"
"github.com/pingcap/parser/model"
"github.com/pingcap/tidb/types"
Expand Down
2 changes: 1 addition & 1 deletion executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"testing"
"time"

gofail "github.com/etcd-io/gofail/runtime"
"github.com/golang/protobuf/proto"
. "github.com/pingcap/check"
"github.com/pingcap/errors"
gofail "github.com/pingcap/gofail/runtime"
pb "github.com/pingcap/kvproto/pkg/kvrpcpb"
"github.com/pingcap/parser"
"github.com/pingcap/parser/model"
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ require (
github.com/opentracing/opentracing-go v1.0.2
github.com/pingcap/check v0.0.0-20171206051426-1c287c953996
github.com/pingcap/errors v0.11.0
github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3
github.com/pingcap/goleveldb v0.0.0-20171020084629-8d44bfdf1030
github.com/pingcap/kvproto v0.0.0-20181109035735-8e3f33ac4929
github.com/pingcap/parser v0.0.0-20181207085916-6c21d4344dfa
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ github.com/pingcap/check v0.0.0-20171206051426-1c287c953996 h1:ZBdiJCMan6GSo/aPA
github.com/pingcap/check v0.0.0-20171206051426-1c287c953996/go.mod h1:B1+S9LNcuMyLH/4HMTViQOJevkGiik3wW2AN9zb2fNQ=
github.com/pingcap/errors v0.11.0 h1:DCJQB8jrHbQ1VVlMFIrbj2ApScNNotVmkSNplu2yUt4=
github.com/pingcap/errors v0.11.0/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3 h1:04yuCf5NMvLU8rB2m4Qs3rynH7EYpMno3lHkewIOdMo=
github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3/go.mod h1:DazNTg0PTldtpsQiT9I5tVJwV1onHMKBBgXzmJUlMns=
github.com/pingcap/goleveldb v0.0.0-20171020084629-8d44bfdf1030 h1:XJLuW0lsP7vAtQ2iPjZwvXZ14m5urp9No+Qr06ZZcTo=
github.com/pingcap/goleveldb v0.0.0-20171020084629-8d44bfdf1030/go.mod h1:O17XtbryoCJhkKGbT62+L2OlrniwqiGLSqrmdHCMzZw=
github.com/pingcap/kvproto v0.0.0-20181109035735-8e3f33ac4929 h1:NAq95+VGsS2G7SjzZ5LP9iUlCMNAs13QUzbNY3G90v8=
Expand Down
2 changes: 1 addition & 1 deletion owner/fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"time"

"github.com/coreos/etcd/clientv3"
gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/parser/terror"
"github.com/pingcap/tidb/util/logutil"
"github.com/pingcap/tidb/util/testleak"
Expand Down
2 changes: 1 addition & 1 deletion session/session_fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
package session_test

import (
gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/tidb/util/testkit"
)

Expand Down
2 changes: 1 addition & 1 deletion store/tikv/2pc_fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
package tikv

import (
gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
"github.com/pingcap/errors"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/parser/terror"
"github.com/pingcap/tidb/kv"
"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion store/tikv/gcworker/gc_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"testing"
"time"

gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/kvproto/pkg/errorpb"
"github.com/pingcap/tidb/domain"
"github.com/pingcap/tidb/session"
Expand Down
2 changes: 1 addition & 1 deletion store/tikv/sql_fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"sync"
"time"

gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/parser/terror"
"github.com/pingcap/tidb/domain"
"github.com/pingcap/tidb/session"
Expand Down
2 changes: 1 addition & 1 deletion store/tikv/store_fail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"sync"
"time"

gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"golang.org/x/net/context"
)

Expand Down
2 changes: 1 addition & 1 deletion tablecodec/tablecodec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"testing"
"time"

gofail "github.com/etcd-io/gofail/runtime"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/parser/mysql"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/sessionctx/stmtctx"
Expand Down
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ github.com/coreos/etcd/pkg/types
github.com/cznic/mathutil
# github.com/cznic/sortutil v0.0.0-20150617083342-4c7342852e65
github.com/cznic/sortutil
# github.com/etcd-io/gofail v0.0.0-20180808172546-51ce9a71510a
github.com/etcd-io/gofail/runtime
# github.com/go-sql-driver/mysql v0.0.0-20170715192408-3955978caca4
github.com/go-sql-driver/mysql
# github.com/gogo/protobuf v1.1.1
Expand Down Expand Up @@ -65,6 +63,8 @@ github.com/opentracing/opentracing-go/log
github.com/pingcap/check
# github.com/pingcap/errors v0.11.0
github.com/pingcap/errors
# github.com/pingcap/gofail v0.0.0-20181217135706-6a951c1e42c3
github.com/pingcap/gofail/runtime
# github.com/pingcap/goleveldb v0.0.0-20171020084629-8d44bfdf1030
github.com/pingcap/goleveldb/leveldb
github.com/pingcap/goleveldb/leveldb/comparer
Expand Down

0 comments on commit 0c7ca13

Please sign in to comment.