You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ti...@apache.org on 2020/06/19 08:29:44 UTC

[servicecomb-service-center] branch master updated: refactor (#648)

This is an automated email from the ASF dual-hosted git repository.

tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new c85596b  refactor (#648)
c85596b is described below

commit c85596b4f61b8b1d87c728bb0b38578f11d1cc12
Author: Shawn <xi...@gmail.com>
AuthorDate: Fri Jun 19 16:29:33 2020 +0800

    refactor (#648)
---
 .github/workflows/static_check.yml                 |  40 ++++
 .gitignore                                         |   2 -
 .travis.yml                                        |   2 +-
 README.md                                          |   5 -
 go.mod                                             |  84 +++------
 pkg/cache/cache.go                                 |   2 +-
 pkg/cache/cache_test.go                            |   2 +-
 pkg/cache/filter.go                                |   2 +-
 pkg/cache/tree.go                                  |   2 +-
 pkg/chain/callback.go                              |   2 +-
 pkg/chain/invocation.go                            |   2 +-
 pkg/client/sc/client.go                            |   2 +-
 pkg/client/sc/client_lb.go                         |   2 +-
 pkg/client/sc/client_lb_test.go                    |   2 +-
 pkg/client/sc/websocket.go                         |   2 +-
 pkg/etcdsync/README.md                             |   2 +-
 pkg/etcdsync/etcdsync_suite_test.go                |  55 ------
 pkg/etcdsync/mutex.go                              | 102 +++++------
 pkg/etcdsync/mutex_test.go                         |  92 ++++++----
 pkg/gopool/goroutines.go                           |   2 +-
 pkg/gopool/goroutines_test.go                      |   2 +-
 pkg/notify/processor.go                            |   2 +-
 pkg/queue/taskqueue.go                             |   2 +-
 pkg/queue/taskqueue_test.go                        |   2 +-
 pkg/queue/uniqueue.go                              |   2 +-
 pkg/queue/uniqueue_test.go                         |   2 +-
 pkg/rest/client.go                                 |   2 +-
 pkg/task/executor.go                               |   2 +-
 pkg/task/service_async.go                          |   2 +-
 pkg/task/service_test.go                           |   2 +-
 pkg/task/task.go                                   |   2 +-
 pkg/util/context.go                                |   2 +-
 pkg/util/context_grpc.go                           |   2 +-
 pkg/util/net.go                                    |   2 +-
 scctl/pkg/plugin/diagnose/compare_holder.go        |   2 +-
 scctl/pkg/plugin/diagnose/diagnose.go              |   2 +-
 scctl/pkg/plugin/get/cluster/cluster_cmd.go        |   2 +-
 scctl/pkg/plugin/get/instance/instance_cmd.go      |   2 +-
 scctl/pkg/plugin/get/schema/schema_cmd.go          |   2 +-
 scctl/pkg/plugin/get/service/service_cmd.go        |   2 +-
 scctl/pkg/plugin/health/cmd.go                     |   2 +-
 scctl/pkg/plugin/version/cmd.go                    |   2 +-
 scripts/build/deps.sh                              |  48 -----
 scripts/build/local.sh                             |   3 -
 scripts/build/tools.sh                             |  48 -----
 scripts/ci/formatChecker.sh                        |   8 +
 scripts/ci/goCycloChecker.sh                       |   8 +
 scripts/ci/misspellChecker.sh                      |   8 +
 scripts/integration_test.sh                        |   4 +-
 server/admin/admin_suite_test.go                   |  50 -----
 server/admin/service.go                            |   2 +-
 server/admin/service_test.go                       |  55 +++---
 server/api.go                                      |   2 +-
 server/broker/broker_suite_test.go                 |   3 +-
 server/broker/service.go                           |   2 +-
 server/broker/service_test.go                      |   8 +-
 server/core/backend/defer_instance.go              |   2 +-
 server/core/backend/discovery.go                   |   2 +-
 server/core/backend/discovery_test.go              |   2 +-
 server/core/backend/lease.go                       |   2 +-
 server/core/backend/lease_test.go                  |   2 +-
 server/core/backend/registry.go                    |   2 +-
 server/core/microservice.go                        |   2 +-
 server/core/microservice_test.go                   |   2 +-
 server/core/proto/services.go                      |   2 +-
 server/core/proto/services.pb.go                   |   2 +-
 server/govern/govern_suite_test.go                 |   5 +-
 server/govern/service.go                           |   2 +-
 server/handler/metric/metric.go                    |   3 +-
 server/health/metrics.go                           |   2 +-
 server/metric/gatherer.go                          |   6 +-
 server/{rest => metric/prometheus}/metrics.go      |   5 +-
 server/{rest => metric/prometheus}/reporter.go     |   2 +-
 server/metric/reporter.go                          |   5 -
 server/mux/mux.go                                  |   4 +-
 server/notify/listwatcher.go                       |   2 +-
 server/notify/publisher.go                         |   2 +-
 server/notify/stream.go                            |   2 +-
 server/notify/stream_test.go                       |   2 +-
 server/notify/websocket.go                         |   2 +-
 server/notify/websocket_test.go                    |   6 +-
 .../pkg/discovery/aggregate/conflict_checker.go    |   2 +-
 server/plugin/pkg/discovery/aggregate/indexer.go   |   2 +-
 server/plugin/pkg/discovery/etcd/cacher_kv.go      |   2 +-
 server/plugin/pkg/discovery/etcd/cacher_kv_test.go |   2 +-
 server/plugin/pkg/discovery/etcd/indexer_cache.go  |   2 +-
 server/plugin/pkg/discovery/etcd/indexer_etcd.go   |   2 +-
 server/plugin/pkg/discovery/etcd/listwatch.go      |   2 +-
 .../plugin/pkg/discovery/etcd/listwatch_inner.go   |   2 +-
 server/plugin/pkg/discovery/etcd/listwatch_test.go |   2 +-
 server/plugin/pkg/discovery/etcd/watcher_inner.go  |   2 +-
 server/plugin/pkg/discovery/etcd/watcher_test.go   |   2 +-
 server/plugin/pkg/discovery/indexer.go             |   2 +-
 server/plugin/pkg/discovery/indexer_cache.go       |   2 +-
 server/plugin/pkg/discovery/indexer_test.go        |   2 +-
 server/plugin/pkg/discovery/k8s/adaptor/common.go  |   2 +-
 .../pkg/discovery/k8s/adaptor/kube_client.go       |   2 +-
 .../pkg/discovery/k8s/adaptor/listwatcher.go       |   2 +-
 .../pkg/discovery/servicecenter/aggregate.go       |   2 +-
 .../pkg/discovery/servicecenter/aggregate_test.go  |   2 +-
 .../plugin/pkg/discovery/servicecenter/indexer.go  |   2 +-
 .../plugin/pkg/discovery/servicecenter/syncer.go   |   2 +-
 server/plugin/pkg/quota/buildin/buildin.go         |   2 +-
 server/plugin/pkg/quota/buildin/common.go          |   2 +-
 server/plugin/pkg/quota/buildin/common_test.go     |   2 +-
 server/plugin/pkg/quota/counter/event.go           |   2 +-
 server/plugin/pkg/quota/quota.go                   |   2 +-
 server/plugin/pkg/quota/unlimit/unlimit.go         |   2 +-
 server/plugin/pkg/registry/buildin/buildin.go      |   2 +-
 server/plugin/pkg/registry/common.go               |   2 +-
 server/plugin/pkg/registry/config.go               |   5 +-
 .../plugin/pkg/registry/embededetcd/embededetcd.go |   2 +-
 server/plugin/pkg/registry/etcd/etcd.go            |  49 +++--
 server/plugin/pkg/registry/etcd/etcd_test.go       | 202 ++++++++++-----------
 server/plugin/pkg/registry/etcd/tracing.go         |   2 +-
 server/plugin/pkg/registry/registry.go             |   2 +-
 server/plugin/pkg/tls/buildin/tls_test.go          |  22 +--
 .../plugin/pkg/tracing/buildin/file_collector.go   |   2 +-
 .../pkg/tracing/buildin/file_collector_test.go     |   2 +-
 server/plugin/pkg/tracing/tracing.go               |   2 +-
 server/plugin/pkg/uuid/buildin/buildin.go          |   2 +-
 server/plugin/pkg/uuid/context/context.go          |   2 +-
 server/plugin/pkg/uuid/uuid.go                     |   2 +-
 server/server.go                                   |   3 +-
 server/service/cache/dependency.go                 |   2 +-
 server/service/cache/filter_consistency.go         |   2 +-
 server/service/cache/filter_consumer.go            |   2 +-
 server/service/cache/filter_instances.go           |   2 +-
 server/service/cache/filter_permission.go          |   2 +-
 server/service/cache/filter_service.go             |   2 +-
 server/service/cache/filter_tags.go                |   2 +-
 server/service/cache/filter_version.go             |   2 +-
 server/service/cache/instance.go                   |   2 +-
 server/service/dependency.go                       |   2 +-
 server/service/event/dependency_event_handler.go   |   2 +-
 .../event/dependency_rule_event_handler_test.go    |   2 +-
 server/service/event/instance_event_handler.go     |   2 +-
 server/service/event/rule_event_handler.go         |   2 +-
 server/service/event/service_event_handler.go      |   2 +-
 server/service/event/tag_event_handler.go          |   2 +-
 server/service/instance.go                         |   2 +-
 server/service/microservice.go                     |   2 +-
 server/service/rule.go                             |   2 +-
 server/service/schema.go                           |   2 +-
 server/service/service_suite_test.go               |   5 +-
 server/service/tag.go                              |   2 +-
 server/service/util/dependency.go                  |   2 +-
 server/service/util/dependency_query.go            |   2 +-
 server/service/util/dependency_test.go             |   2 +-
 server/service/util/dependency_util.go             |   2 +-
 server/service/util/domain_util.go                 |   2 +-
 server/service/util/domain_util_test.go            |   2 +-
 server/service/util/heartbeat_util.go              |   2 +-
 server/service/util/heartbeat_util_test.go         |   2 +-
 server/service/util/instance_util.go               |   2 +-
 server/service/util/instance_util_test.go          |   2 +-
 server/service/util/microservice_util.go           |   2 +-
 server/service/util/rule_util.go                   |   2 +-
 server/service/util/rule_util_test.go              |   2 +-
 server/service/util/schema_util.go                 |   2 +-
 server/service/util/schema_util_test.go            |   2 +-
 server/service/util/tag_util.go                    |   2 +-
 server/service/util/tag_util_test.go               |   2 +-
 server/service/util/util.go                        |   2 +-
 server/service/util/util_suite_test.go             |   2 +-
 server/service/watch.go                            |   2 +-
 server/service/watch_test.go                       |   2 +-
 server/task/clear_service_test.go                  |  10 +-
 server/version.go                                  |   2 +-
 syncer/config/config.go                            |   2 +-
 syncer/config/config_test.go                       |   4 +-
 syncer/grpc/grpc_test.go                           |   4 +-
 syncer/pkg/mock/mockplugin/instance.go             |   3 +-
 syncer/pkg/mock/mockplugin/servicecenter.go        |  44 ++---
 syncer/proto/syncer.pb.go                          |   2 +-
 .../servicecenter/hello-server/main.go             |   2 +-
 syncer/servicecenter/storage/operation.go          |   2 +-
 syncer/servicecenter/storage/storage.go            |   2 +-
 178 files changed, 564 insertions(+), 728 deletions(-)

diff --git a/.github/workflows/static_check.yml b/.github/workflows/static_check.yml
new file mode 100644
index 0000000..6be175f
--- /dev/null
+++ b/.github/workflows/static_check.yml
@@ -0,0 +1,40 @@
+name: Merge check
+on: [push, pull_request]
+jobs:
+  build:
+    name: Merge check
+    runs-on: ubuntu-latest
+    steps:
+
+    - name: Set up Go 1.13
+      uses: actions/setup-go@v1
+      with:
+        go-version: 1.13
+      id: go
+
+    - name: Check out code into the Go module directory
+      uses: actions/checkout@v1
+
+    - name: Build
+      run: go build -v .
+
+    - name: Fmt
+      run: |
+        bash scripts/ci/formatChecker.sh
+    - name: Misspell
+      run: |
+        go get -u github.com/client9/misspell/cmd/misspell
+        bash scripts/ci/formatChecker.sh
+    - name: Cyclo
+      run: |
+        go get github.com/fzipp/gocyclo
+        bash scripts/ci/goCycloChecker.sh
+    - name: build
+      run: |
+        bash -x scripts/build/local.sh
+    - name: UT
+      run: |
+        bash -x scripts/ut_test_in_docker.sh
+    - name: Integration Testing
+      run: |
+        bash -x scripts/integration_test.sh
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 3a3ad28..cde0957 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,7 +27,5 @@ etc/ssl/
 frontend/bower_components/
 frontend/node_modules/
 tmp/
-glide.lock
 servicecomb-service-center
-go.sum
 service-center
diff --git a/.travis.yml b/.travis.yml
index 6a9e37a..8be649c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ services:
   - docker
 
 go:
-  - 1.11
+  - 1.14
 
 before_install:
   - go get github.com/mattn/goveralls
diff --git a/README.md b/README.md
index c215723..810d44e 100644
--- a/README.md
+++ b/README.md
@@ -95,7 +95,6 @@ cd $GOPATH/src/github.com/apache/servicecomb-service-center
 
 Dependencies
 
-By default, we use [glide](https://glide.sh)(version: 0.13+) to manage dependencies. If the go version greater then `go1.11`,
 you can download dependencies directly using command `go mod`. Please follow below steps to
 download all the dependency.
 
@@ -103,10 +102,6 @@ download all the dependency.
 # greater then go1.11
 GO111MODULE=on go mod download
 GO111MODULE=on go mod vendor
-
-# lower than go1.11
-curl https://glide.sh/get | sh
-glide install
 ```
 
 Build the Service-Center
diff --git a/go.mod b/go.mod
index 6bfffe9..e711d7a 100644
--- a/go.mod
+++ b/go.mod
@@ -1,94 +1,70 @@
 module github.com/apache/servicecomb-service-center
 
-replace (
-	github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b => github.com/go-chassis/glog v0.0.0-20180920075250-95a09b2413e9
-	go.uber.org/zap v1.9.0 => github.com/uber-go/zap v1.9.0
-	golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 => github.com/golang/crypto v0.0.0-20180904163835-0709b304e793
-	golang.org/x/net v0.0.0-20180824152047-4bcd98cce591 => github.com/golang/net v0.0.0-20180824152047-4bcd98cce591
-	golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 => github.com/golang/sys v0.0.0-20180905080454-ebe1bf3edb33
-	golang.org/x/text v0.0.0-20170627122817-6353ef0f9243 => github.com/golang/text v0.0.0-20170627122817-6353ef0f9243
-	golang.org/x/time v0.0.0-20170424234030-8be79e1e0910 => github.com/golang/time v0.0.0-20170424234030-8be79e1e0910
-	google.golang.org/genproto v0.0.0-20170531203552-aa2eb687b4d3 => github.com/google/go-genproto v0.0.0-20170531203552-aa2eb687b4d3
-	google.golang.org/grpc v1.7.5 => github.com/grpc/grpc-go v1.7.5
-	k8s.io/api v0.0.0-20180601181742-8b7507fac302 => github.com/kubernetes/api v0.0.0-20180601181742-8b7507fac302
-	k8s.io/apimachinery v0.0.0-20180601181227-17529ec7eadb => github.com/kubernetes/apimachinery v0.0.0-20180601181227-17529ec7eadb
-	k8s.io/client-go v2.0.0-alpha.0.0.20180817174322-745ca8300397+incompatible => github.com/kubernetes/client-go v0.0.0-20180817174322-745ca8300397
-)
+replace github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b => github.com/go-chassis/glog v0.0.0-20180920075250-95a09b2413e9
 
 require (
-	github.com/BurntSushi/toml v0.3.1 // indirect
 	github.com/NYTimes/gziphandler v1.0.2-0.20180820182813-253f1acb9d9f
 	github.com/Shopify/sarama v1.18.0 // indirect
 	github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect
 	github.com/apache/thrift v0.0.0-20180125231006-3d556248a8b9 // indirect
 	github.com/astaxie/beego v1.8.0
-	github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
+	github.com/cespare/xxhash v1.1.0 // indirect
 	github.com/cheggaaa/pb v1.0.25
+	github.com/coocood/freecache v1.0.1 // indirect
 	github.com/coreos/bbolt v1.3.3 // indirect
 	github.com/coreos/etcd v3.3.8+incompatible
 	github.com/coreos/go-semver v0.2.0 // indirect
 	github.com/coreos/go-systemd v0.0.0-20180828140353-eee3db372b31 // indirect
 	github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea // v4
-	github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
 	github.com/eapache/go-resiliency v1.1.0 // indirect
 	github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
 	github.com/eapache/queue v1.1.0 // indirect
-	github.com/fsnotify/fsnotify v1.4.7 // indirect
 	github.com/ghodss/yaml v1.0.0 // indirect
+	github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 // indirect
+	github.com/gin-gonic/gin v1.3.0 // indirect
+	github.com/go-chassis/go-chassis v1.8.2 // indirect
 	github.com/go-chassis/paas-lager v1.1.1
-	github.com/go-logfmt/logfmt v0.3.0 // indirect
-	github.com/go-mesh/openlogging v1.0.1 // indirect
-	github.com/gogo/protobuf v1.1.1
-	github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
+	github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
 	github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
-	github.com/golang/protobuf v1.0.0
+	github.com/golang/protobuf v1.3.2
 	github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
-	github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
 	github.com/googleapis/gnostic v0.2.0 // indirect
-	github.com/gorilla/websocket v1.2.0
+	github.com/gorilla/websocket v1.4.0
 	github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
 	github.com/grpc-ecosystem/grpc-gateway v1.3.0 // indirect
 	github.com/hashicorp/mdns v1.0.1 // indirect
-	github.com/hashicorp/memberlist v0.1.3
 	github.com/hashicorp/serf v0.8.3
 	github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c // indirect
-	github.com/hpcloud/tail v1.0.0 // indirect
 	github.com/imdario/mergo v0.3.6 // indirect
 	github.com/inconshreveable/mousetrap v1.0.0 // indirect
 	github.com/jonboulle/clockwork v0.1.0 // indirect
-	github.com/json-iterator/go v1.1.5 // indirect
 	github.com/karlseguin/ccache v2.0.3-0.20170217060820-3ba9789cfd2c+incompatible
 	github.com/karlseguin/expect v1.0.1 // indirect
-	github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 // indirect
 	github.com/labstack/echo v3.2.2-0.20180316170059-a5d81b8d4a62+incompatible
 	github.com/labstack/gommon v0.2.1 // indirect
-	github.com/mattn/go-isatty v0.0.4 // indirect
+	github.com/mattn/go-isatty v0.0.7 // indirect
 	github.com/mattn/go-runewidth v0.0.3 // indirect
-	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
-	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
-	github.com/modern-go/reflect2 v1.0.1 // indirect
 	github.com/natefinch/lumberjack v0.0.0-20170531160350-a96e63847dc3
 	github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84
-	github.com/onsi/ginkgo v1.6.0
-	github.com/onsi/gomega v1.4.1
+	github.com/onsi/ginkgo v1.10.1
+	github.com/onsi/gomega v1.7.0
 	github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect
 	github.com/opentracing/opentracing-go v1.0.2
 	github.com/openzipkin/zipkin-go-opentracing v0.3.3-0.20180123190626-6bb822a7f15f
 	github.com/pborman/uuid v1.2.0 // indirect
 	github.com/pierrec/lz4 v2.0.5+incompatible // indirect
 	github.com/pkg/errors v0.8.1
-	github.com/prometheus/client_golang v0.8.1-0.20170628125436-ab4214782d02
-	github.com/prometheus/client_model v0.0.0-20170216185247-6f3806018612
-	github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e // indirect
-	github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273
+	github.com/prometheus/client_golang v0.9.1
+	github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f
+	github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1
 	github.com/rcrowley/go-metrics v0.0.0-20180503174638-e2704e165165 // indirect
 	github.com/rs/cors v0.0.0-20170608165155-8dd4211afb5d // v1.1
 	github.com/satori/go.uuid v1.1.0
 	github.com/sirupsen/logrus v1.3.0 // indirect
 	github.com/soheilhy/cmux v0.1.4 // indirect
 	github.com/spf13/cobra v0.0.0-20170624150100-4d647c8944eb
-	github.com/spf13/pflag v1.0.0
-	github.com/stretchr/testify v1.3.0
+	github.com/spf13/pflag v1.0.5
+	github.com/stretchr/testify v1.4.0
 	github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
 	github.com/ugorji/go v1.1.1 // indirect
 	github.com/valyala/bytebufferpool v1.0.0 // indirect
@@ -96,23 +72,21 @@ require (
 	github.com/widuu/gojson v0.0.0-20170212122013-7da9d2cd949b
 	github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 // indirect
 	github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 // indirect
-	go.uber.org/atomic v1.3.2 // indirect
+	go.etcd.io/bbolt v1.3.4 // indirect
+	go.uber.org/atomic v1.5.0 // indirect
 	go.uber.org/multierr v1.1.0 // indirect
+	go.uber.org/ratelimit v0.1.0 // indirect
 	go.uber.org/zap v1.9.0
-	golang.org/x/net v0.0.0-20181201002055-351d144fa1fc
-	golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 // indirect
-	golang.org/x/text v0.0.0-20170627122817-6353ef0f9243 // indirect
-	golang.org/x/time v0.0.0-20170424234030-8be79e1e0910 // indirect
-	google.golang.org/genproto v0.0.0-20170531203552-aa2eb687b4d3 // indirect
-	google.golang.org/grpc v1.7.5
+	google.golang.org/grpc v1.19.0
 	gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
-	gopkg.in/fsnotify.v1 v1.4.7 // indirect
-	gopkg.in/inf.v0 v0.9.1 // indirect
+	gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
+	gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
 	gopkg.in/karlseguin/expect.v1 v1.0.1 // indirect
 	gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
-	gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
-	gopkg.in/yaml.v2 v2.2.1
-	k8s.io/api v0.0.0-20180601181742-8b7507fac302
-	k8s.io/apimachinery v0.0.0-20180601181227-17529ec7eadb
-	k8s.io/client-go v2.0.0-alpha.0.0.20180817174322-745ca8300397+incompatible
+	gopkg.in/yaml.v2 v2.2.4
+	k8s.io/api v0.17.0
+	k8s.io/apimachinery v0.17.0
+	k8s.io/client-go v0.17.0
 )
+
+go 1.13
diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go
index 7f53552..3d02aba 100644
--- a/pkg/cache/cache.go
+++ b/pkg/cache/cache.go
@@ -17,7 +17,7 @@
 package cache
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"sync"
 )
 
diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go
index bfd337e..c0d70ee 100644
--- a/pkg/cache/cache_test.go
+++ b/pkg/cache/cache_test.go
@@ -17,8 +17,8 @@
 package cache
 
 import (
+	"context"
 	"fmt"
-	"golang.org/x/net/context"
 	"testing"
 	"time"
 )
diff --git a/pkg/cache/filter.go b/pkg/cache/filter.go
index 9652fcf..234fbb2 100644
--- a/pkg/cache/filter.go
+++ b/pkg/cache/filter.go
@@ -16,7 +16,7 @@
  */
 package cache
 
-import "golang.org/x/net/context"
+import "context"
 
 type Filter interface {
 	Name(ctx context.Context, parent *Node) string
diff --git a/pkg/cache/tree.go b/pkg/cache/tree.go
index d9adcf5..f7fbbf8 100644
--- a/pkg/cache/tree.go
+++ b/pkg/cache/tree.go
@@ -17,9 +17,9 @@
 package cache
 
 import (
+	"context"
 	"errors"
 	"github.com/karlseguin/ccache"
-	"golang.org/x/net/context"
 	"sync"
 )
 
diff --git a/pkg/chain/callback.go b/pkg/chain/callback.go
index 7f2bd8a..784ee19 100644
--- a/pkg/chain/callback.go
+++ b/pkg/chain/callback.go
@@ -17,9 +17,9 @@
 package chain
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
-	"golang.org/x/net/context"
 )
 
 var pool = gopool.New(context.Background())
diff --git a/pkg/chain/invocation.go b/pkg/chain/invocation.go
index 72840cb..a4a391a 100644
--- a/pkg/chain/invocation.go
+++ b/pkg/chain/invocation.go
@@ -17,10 +17,10 @@
 package chain
 
 import (
+	"context"
 	errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"golang.org/x/net/context"
 )
 
 type InvocationOption func(op InvocationOp) InvocationOp
diff --git a/pkg/client/sc/client.go b/pkg/client/sc/client.go
index 570d5a2..6279328 100644
--- a/pkg/client/sc/client.go
+++ b/pkg/client/sc/client.go
@@ -16,7 +16,7 @@
 package sc
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"net/http"
 )
 
diff --git a/pkg/client/sc/client_lb.go b/pkg/client/sc/client_lb.go
index 8b99b01..de0a904 100644
--- a/pkg/client/sc/client_lb.go
+++ b/pkg/client/sc/client_lb.go
@@ -16,12 +16,12 @@
 package sc
 
 import (
+	"context"
 	"errors"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/lb"
 	"github.com/apache/servicecomb-service-center/pkg/rest"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"golang.org/x/net/context"
 	"net/http"
 )
 
diff --git a/pkg/client/sc/client_lb_test.go b/pkg/client/sc/client_lb_test.go
index 0dcf159..b7d4300 100644
--- a/pkg/client/sc/client_lb_test.go
+++ b/pkg/client/sc/client_lb_test.go
@@ -16,9 +16,9 @@
 package sc
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/rest"
-	"golang.org/x/net/context"
 	"io/ioutil"
 	"net/http"
 	"net/http/httptest"
diff --git a/pkg/client/sc/websocket.go b/pkg/client/sc/websocket.go
index 8013d49..1898c4c 100644
--- a/pkg/client/sc/websocket.go
+++ b/pkg/client/sc/websocket.go
@@ -41,7 +41,7 @@ func (c *LBClient) WebsocketDial(ctx context.Context, api string, headers http.H
 		} else {
 			addr.Scheme = "ws"
 		}
-		conn, _, err = dialer.Dial(addr.String() + api, headers)
+		conn, _, err = dialer.Dial(addr.String()+api, headers)
 		if err == nil {
 			break
 		}
diff --git a/pkg/etcdsync/README.md b/pkg/etcdsync/README.md
index 06b68b4..6fc9269 100644
--- a/pkg/etcdsync/README.md
+++ b/pkg/etcdsync/README.md
@@ -3,7 +3,7 @@
 ## example
 
 ```go
-lock, _ := etcdsync.Lock("/test", true)
+lock, _ := etcdsync.Lock("/test",-1, true)
 defer lock.Unlock()
 //do something
 g += 1
diff --git a/pkg/etcdsync/etcdsync_suite_test.go b/pkg/etcdsync/etcdsync_suite_test.go
deleted file mode 100644
index 442911e..0000000
--- a/pkg/etcdsync/etcdsync_suite_test.go
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package etcdsync
-
-import (
-	"fmt"
-	_ "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry/etcd"
-	_ "github.com/apache/servicecomb-service-center/server/plugin/pkg/tracing/buildin"
-	"github.com/astaxie/beego"
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-	"testing"
-)
-
-func init() {
-	beego.AppConfig.Set("registry_plugin", "etcd")
-}
-
-var _ = BeforeSuite(func() {
-	//init plugin
-	IsDebug = true
-})
-
-func TestEtcdsync(t *testing.T) {
-	RegisterFailHandler(Fail)
-	RunSpecs(t, "Etcdsync Suite")
-}
-
-func BenchmarkLock(b *testing.B) {
-	var g = 0
-	b.RunParallel(func(pb *testing.PB) {
-		for pb.Next() {
-			lock, _ := Lock("/test", true)
-			//do something
-			g += 1
-			fmt.Println(g)
-			lock.Unlock()
-		}
-	})
-	fmt.Println("Parallel:", b.N)
-}
diff --git a/pkg/etcdsync/mutex.go b/pkg/etcdsync/mutex.go
index 94e7acd..a6b8459 100644
--- a/pkg/etcdsync/mutex.go
+++ b/pkg/etcdsync/mutex.go
@@ -17,6 +17,7 @@
 package etcdsync
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
@@ -24,7 +25,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/coreos/etcd/client"
-	"golang.org/x/net/context"
 	"os"
 	"sync"
 	"time"
@@ -38,53 +38,39 @@ const (
 	OperationGlobalLock = "GLOBAL_LOCK"
 )
 
-type DLockFactory struct {
-	key   string
-	ctx   context.Context
-	ttl   int64
-	mutex *sync.Mutex
-}
-
 type DLock struct {
-	builder  *DLockFactory
+	key      string
+	ctx      context.Context
+	ttl      int64
+	mutex    *sync.Mutex
 	id       string
 	createAt time.Time
 }
 
 var (
-	globalMap = make(map[string]*DLockFactory)
 	globalMux sync.Mutex
 	IsDebug   bool
 	hostname  = util.HostName()
 	pid       = os.Getpid()
+	mutex     = new(sync.Mutex)
 )
 
-// lock will not be release automatically if ttl = 0
-func NewLockFactory(key string, ttl int64) *DLockFactory {
+func NewDLock(key string, ttl int64, wait bool) (l *DLock, err error) {
 	if len(key) == 0 {
-		return nil
+		return nil, nil
 	}
 	if ttl < 1 {
 		ttl = DEFAULT_LOCK_TTL
 	}
 
-	return &DLockFactory{
-		key:   key,
-		ctx:   context.Background(),
-		ttl:   ttl,
-		mutex: new(sync.Mutex),
-	}
-}
-
-func (m *DLockFactory) NewDLock(wait bool) (l *DLock, err error) {
-	if !IsDebug {
-		m.mutex.Lock()
-	}
 	now := time.Now()
 	l = &DLock{
-		builder:  m,
+		key:      key,
+		ctx:      context.Background(),
+		ttl:      ttl,
 		id:       fmt.Sprintf("%v-%v-%v", hostname, pid, now.Format("20060102-15:04:05.999999999")),
 		createAt: now,
+		mutex:    &sync.Mutex{},
 	}
 	for try := 1; try <= DEFAULT_RETRY_TIMES; try++ {
 		err = l.Lock(wait)
@@ -97,12 +83,8 @@ func (m *DLockFactory) NewDLock(wait bool) (l *DLock, err error) {
 		}
 	}
 	// failed
-	log.Errorf(err, "Lock key %s failed, id=%s", m.key, l.id)
+	log.Errorf(err, "Lock key %s failed, id=%s", l.key, l.id)
 	l = nil
-
-	if !IsDebug {
-		m.mutex.Unlock()
-	}
 	return
 }
 
@@ -111,82 +93,87 @@ func (m *DLock) ID() string {
 }
 
 func (m *DLock) Lock(wait bool) (err error) {
+	if !IsDebug {
+		m.mutex.Lock()
+	}
+
 	opts := []registry.PluginOpOption{
-		registry.WithStrKey(m.builder.key),
+		registry.WithStrKey(m.key),
 		registry.WithStrValue(m.id)}
 
-	log.Infof("Trying to create a lock: key=%s, id=%s", m.builder.key, m.id)
+	log.Infof("Trying to create a lock: key=%s, id=%s", m.key, m.id)
 
 	var leaseID int64
 	putOpts := opts
-	if m.builder.ttl > 0 {
-		leaseID, err = backend.Registry().LeaseGrant(m.builder.ctx, m.builder.ttl)
+	if m.ttl > 0 {
+		leaseID, err = backend.Registry().LeaseGrant(m.ctx, m.ttl)
 		if err != nil {
 			return err
 		}
 		putOpts = append(opts, registry.WithLease(leaseID))
 	}
-	success, err := backend.Registry().PutNoOverride(m.builder.ctx, putOpts...)
+	success, err := backend.Registry().PutNoOverride(m.ctx, putOpts...)
 	if err == nil && success {
-		log.Infof("Create Lock OK, key=%s, id=%s", m.builder.key, m.id)
+		log.Infof("Create Lock OK, key=%s, id=%s", m.key, m.id)
 		return nil
 	}
 
 	if leaseID > 0 {
-		backend.Registry().LeaseRevoke(m.builder.ctx, leaseID)
+		backend.Registry().LeaseRevoke(m.ctx, leaseID)
 	}
 
-	if m.builder.ttl == 0 || !wait {
-		return fmt.Errorf("Key %s is locked by id=%s", m.builder.key, m.id)
+	if m.ttl == 0 || !wait {
+		return fmt.Errorf("key %s is locked by id=%s", m.key, m.id)
 	}
 
-	log.Errorf(err, "Key %s is locked, waiting for other node releases it, id=%s", m.builder.key, m.id)
+	log.Errorf(err, "Key %s is locked, waiting for other node releases it, id=%s", m.key, m.id)
 
-	ctx, cancel := context.WithTimeout(m.builder.ctx, time.Duration(m.builder.ttl)*time.Second)
+	ctx, cancel := context.WithTimeout(m.ctx, time.Duration(m.ttl)*time.Second)
 	gopool.Go(func(context.Context) {
 		defer cancel()
 		err := backend.Registry().Watch(ctx,
-			registry.WithStrKey(m.builder.key),
+			registry.WithStrKey(m.key),
 			registry.WithWatchCallback(
 				func(message string, evt *registry.PluginResponse) error {
 					if evt != nil && evt.Action == registry.Delete {
 						// break this for-loop, and try to create the node again.
-						return fmt.Errorf("Lock released")
+						return fmt.Errorf("lock released")
 					}
 					return nil
 				}))
 		if err != nil {
-			log.Warnf("%s, key=%s, id=%s", err.Error(), m.builder.key, m.id)
+			log.Warnf("%s, key=%s, id=%s", err.Error(), m.key, m.id)
 		}
 	})
 	select {
 	case <-ctx.Done():
 		return ctx.Err() // 可以重新尝试获取锁
-	case <-m.builder.ctx.Done():
+	case <-m.ctx.Done():
 		cancel()
-		return m.builder.ctx.Err() // 机制错误,不应该超时的
+		return m.ctx.Err() // 机制错误,不应该超时的
 	}
 }
 
 func (m *DLock) Unlock() (err error) {
 	defer func() {
 		if !IsDebug {
-			m.builder.mutex.Unlock()
+			m.mutex.Unlock()
 		}
+
 		registry.ReportBackendOperationCompleted(OperationGlobalLock, nil, m.createAt)
 	}()
 
 	opts := []registry.PluginOpOption{
 		registry.DEL,
-		registry.WithStrKey(m.builder.key)}
+		registry.WithStrKey(m.key)}
 
 	for i := 1; i <= DEFAULT_RETRY_TIMES; i++ {
-		_, err = backend.Registry().Do(m.builder.ctx, opts...)
+		_, err = backend.Registry().Do(m.ctx, opts...)
 		if err == nil {
-			log.Infof("Delete lock OK, key=%s, id=%s", m.builder.key, m.id)
+			log.Infof("Delete lock OK, key=%s, id=%s", m.key, m.id)
 			return nil
 		}
-		log.Errorf(err, "Delete lock failed, key=%s, id=%s", m.builder.key, m.id)
+		log.Errorf(err, "Delete lock failed, key=%s, id=%s", m.key, m.id)
 		e, ok := err.(client.Error)
 		if ok && e.Code == client.ErrorCodeKeyNotFound {
 			return nil
@@ -195,13 +182,6 @@ func (m *DLock) Unlock() (err error) {
 	return err
 }
 
-func Lock(key string, wait bool) (*DLock, error) {
-	globalMux.Lock()
-	lc, ok := globalMap[key]
-	if !ok {
-		lc = NewLockFactory(fmt.Sprintf("%s%s", ROOT_PATH, key), -1)
-		globalMap[key] = lc
-	}
-	globalMux.Unlock()
-	return lc.NewDLock(wait)
+func Lock(key string, ttl int64, wait bool) (*DLock, error) {
+	return NewDLock(fmt.Sprintf("%s%s", ROOT_PATH, key), ttl, wait)
 }
diff --git a/pkg/etcdsync/mutex_test.go b/pkg/etcdsync/mutex_test.go
index e602388..bef2fee 100644
--- a/pkg/etcdsync/mutex_test.go
+++ b/pkg/etcdsync/mutex_test.go
@@ -14,51 +14,69 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package etcdsync
+package etcdsync_test
 
 import (
 	"fmt"
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
+	"github.com/apache/servicecomb-service-center/pkg/etcdsync"
+	"github.com/astaxie/beego"
+	"github.com/stretchr/testify/assert"
+	"testing"
+
+	_ "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry/etcd"
+	_ "github.com/apache/servicecomb-service-center/server/plugin/pkg/tracing/buildin"
 )
 
-var _ = Describe("Mutex", func() {
-	Context("normal", func() {
-		It("TestLockTimeout", func() {
-			m1 := NewLockFactory("key1", 5)
-			m2 := NewLockFactory("key1", 1)
-			l1, err := m1.NewDLock(true)
-			Expect(l1).ToNot(BeNil())
-			Expect(err).To(BeNil())
+func init() {
+	beego.AppConfig.Set("registry_plugin", "etcd")
+	//init plugin
+	etcdsync.IsDebug = true
+}
+
+func TestLock(t *testing.T) {
+	m1, err := etcdsync.Lock("key1", 5, true)
+	assert.NoError(t, err)
+	assert.NotNil(t, m1)
+	t.Log("m1 locked")
+
+	ch := make(chan bool)
+	go func() {
+		m2, err := etcdsync.Lock("key1", 1, false)
 
-			fmt.Println("UT===================m1 locked")
-			ch := make(chan bool)
-			go func() {
-				l2, err := m2.NewDLock(false)
-				Expect(l2).To(BeNil())
-				Expect(err).ToNot(BeNil())
-				fmt.Println("UT===================m2 try failed")
+		assert.Nil(t, m2)
+		assert.Error(t, err)
+		fmt.Println("m2 try failed")
 
-				l2, err = m2.NewDLock(true) // 1s * 3
-				Expect(l2).To(BeNil())
-				Expect(err).ToNot(BeNil())
-				fmt.Println("UT===================m2 timed out")
-				ch <- true
-			}()
-			<-ch
+		m2, err = etcdsync.Lock("key1", 1, true)
+		assert.Nil(t, m2)
+		assert.Error(t, err)
+		fmt.Println("m2 timed out")
+		ch <- true
+	}()
+	<-ch
 
-			m3 := NewLockFactory("key1", 2)
-			l3, err := m3.NewDLock(true)
-			Expect(l3).ToNot(BeNil())
-			Expect(err).To(BeNil())
+	m3, err := etcdsync.Lock("key1", 2, true)
+	assert.NoError(t, err)
+	assert.NotNil(t, m3)
 
-			fmt.Println("UT===================m3 locked")
-			err = l3.Unlock()
-			Expect(err).To(BeNil())
+	fmt.Println("m3 locked")
+	err = m3.Unlock()
+	assert.NoError(t, err)
 
-			err = l1.Unlock()
-			Expect(err).To(BeNil())
-			fmt.Println("UT===================m1 unlocked")
-		})
+	err = m1.Unlock()
+	assert.NoError(t, err)
+	fmt.Println("m1 unlocked")
+}
+func BenchmarkLock(b *testing.B) {
+	var g = 0
+	b.RunParallel(func(pb *testing.PB) {
+		for pb.Next() {
+			lock, _ := etcdsync.Lock("/test", -1, true)
+			//do something
+			g += 1
+			fmt.Println(g)
+			lock.Unlock()
+		}
 	})
-})
+	fmt.Println("Parallel:", b.N)
+}
diff --git a/pkg/gopool/goroutines.go b/pkg/gopool/goroutines.go
index 79b9237..9bfb15b 100644
--- a/pkg/gopool/goroutines.go
+++ b/pkg/gopool/goroutines.go
@@ -17,9 +17,9 @@
 package gopool
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"golang.org/x/net/context"
 	"sync"
 	"time"
 )
diff --git a/pkg/gopool/goroutines_test.go b/pkg/gopool/goroutines_test.go
index bfdb4e7..246c296 100644
--- a/pkg/gopool/goroutines_test.go
+++ b/pkg/gopool/goroutines_test.go
@@ -17,8 +17,8 @@
 package gopool
 
 import (
+	"context"
 	"fmt"
-	"golang.org/x/net/context"
 	"sync"
 	"testing"
 	"time"
diff --git a/pkg/notify/processor.go b/pkg/notify/processor.go
index 9df5288..73f2e70 100644
--- a/pkg/notify/processor.go
+++ b/pkg/notify/processor.go
@@ -17,9 +17,9 @@
 package notify
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/queue"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"golang.org/x/net/context"
 )
 
 type Processor struct {
diff --git a/pkg/queue/taskqueue.go b/pkg/queue/taskqueue.go
index 525211e..e59cec5 100644
--- a/pkg/queue/taskqueue.go
+++ b/pkg/queue/taskqueue.go
@@ -16,8 +16,8 @@
 package queue
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
-	"golang.org/x/net/context"
 )
 
 const (
diff --git a/pkg/queue/taskqueue_test.go b/pkg/queue/taskqueue_test.go
index 2ad5f34..8c79da4 100644
--- a/pkg/queue/taskqueue_test.go
+++ b/pkg/queue/taskqueue_test.go
@@ -16,7 +16,7 @@
 package queue
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"testing"
 )
 
diff --git a/pkg/queue/uniqueue.go b/pkg/queue/uniqueue.go
index 92a59ec..d132ebb 100644
--- a/pkg/queue/uniqueue.go
+++ b/pkg/queue/uniqueue.go
@@ -17,9 +17,9 @@
 package queue
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
-	"golang.org/x/net/context"
 )
 
 type UniQueue struct {
diff --git a/pkg/queue/uniqueue_test.go b/pkg/queue/uniqueue_test.go
index 21f5121..7d04ce4 100644
--- a/pkg/queue/uniqueue_test.go
+++ b/pkg/queue/uniqueue_test.go
@@ -17,8 +17,8 @@
 package queue
 
 import (
+	"context"
 	"fmt"
-	"golang.org/x/net/context"
 	"sync/atomic"
 	"testing"
 	"time"
diff --git a/pkg/rest/client.go b/pkg/rest/client.go
index c2aa631..51a900c 100644
--- a/pkg/rest/client.go
+++ b/pkg/rest/client.go
@@ -34,7 +34,7 @@ import (
 	"github.com/apache/servicecomb-service-center/pkg/tlsutil"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 var defaultURLClientOption = URLClientOption{
diff --git a/pkg/task/executor.go b/pkg/task/executor.go
index e48fc5c..9e0b608 100644
--- a/pkg/task/executor.go
+++ b/pkg/task/executor.go
@@ -17,10 +17,10 @@
 package task
 
 import (
+	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/queue"
-	"golang.org/x/net/context"
 )
 
 type Executor struct {
diff --git a/pkg/task/service_async.go b/pkg/task/service_async.go
index fc0d3db..0b96d70 100644
--- a/pkg/task/service_async.go
+++ b/pkg/task/service_async.go
@@ -17,11 +17,11 @@
 package task
 
 import (
+	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
-	"golang.org/x/net/context"
 	"sync"
 	"sync/atomic"
 	"time"
diff --git a/pkg/task/service_test.go b/pkg/task/service_test.go
index ee4076e..83d3e11 100644
--- a/pkg/task/service_test.go
+++ b/pkg/task/service_test.go
@@ -19,8 +19,8 @@ package task
 import (
 	"testing"
 
+	"context"
 	"errors"
-	"golang.org/x/net/context"
 	"time"
 )
 
diff --git a/pkg/task/task.go b/pkg/task/task.go
index bff9211..0788ef5 100644
--- a/pkg/task/task.go
+++ b/pkg/task/task.go
@@ -16,7 +16,7 @@
  */
 package task
 
-import "golang.org/x/net/context"
+import "context"
 
 type Task interface {
 	Key() string
diff --git a/pkg/util/context.go b/pkg/util/context.go
index 838d4a6..fe326cc 100644
--- a/pkg/util/context.go
+++ b/pkg/util/context.go
@@ -17,7 +17,7 @@
 package util
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"net/http"
 	"time"
 )
diff --git a/pkg/util/context_grpc.go b/pkg/util/context_grpc.go
index d2badb6..bbb10f8 100644
--- a/pkg/util/context_grpc.go
+++ b/pkg/util/context_grpc.go
@@ -16,7 +16,7 @@
 package util
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"google.golang.org/grpc/metadata"
 )
 
diff --git a/pkg/util/net.go b/pkg/util/net.go
index c304933..f890d55 100644
--- a/pkg/util/net.go
+++ b/pkg/util/net.go
@@ -17,7 +17,7 @@
 package util
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"net"
 	"net/http"
 	"net/url"
diff --git a/scctl/pkg/plugin/diagnose/compare_holder.go b/scctl/pkg/plugin/diagnose/compare_holder.go
index 034e33a..08ba9df 100644
--- a/scctl/pkg/plugin/diagnose/compare_holder.go
+++ b/scctl/pkg/plugin/diagnose/compare_holder.go
@@ -16,12 +16,12 @@
 package diagnose
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/server/admin/model"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/coreos/etcd/mvcc/mvccpb"
-	"golang.org/x/net/context"
 )
 
 type CompareHolder interface {
diff --git a/scctl/pkg/plugin/diagnose/diagnose.go b/scctl/pkg/plugin/diagnose/diagnose.go
index b3e2833..da0c8be 100644
--- a/scctl/pkg/plugin/diagnose/diagnose.go
+++ b/scctl/pkg/plugin/diagnose/diagnose.go
@@ -17,6 +17,7 @@ package diagnose
 
 import (
 	"bytes"
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/client/etcd"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
@@ -25,7 +26,6 @@ import (
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/mvcc/mvccpb"
 	"github.com/spf13/cobra"
-	"golang.org/x/net/context"
 )
 
 const (
diff --git a/scctl/pkg/plugin/get/cluster/cluster_cmd.go b/scctl/pkg/plugin/get/cluster/cluster_cmd.go
index 012c7ba..4a2bacf 100644
--- a/scctl/pkg/plugin/get/cluster/cluster_cmd.go
+++ b/scctl/pkg/plugin/get/cluster/cluster_cmd.go
@@ -16,12 +16,12 @@
 package cluster
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/plugin/get"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/writer"
 	"github.com/spf13/cobra"
-	"golang.org/x/net/context"
 )
 
 func init() {
diff --git a/scctl/pkg/plugin/get/instance/instance_cmd.go b/scctl/pkg/plugin/get/instance/instance_cmd.go
index 4161e8c..fe07153 100644
--- a/scctl/pkg/plugin/get/instance/instance_cmd.go
+++ b/scctl/pkg/plugin/get/instance/instance_cmd.go
@@ -16,6 +16,7 @@
 package instance
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/model"
@@ -24,7 +25,6 @@ import (
 	admin "github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/spf13/cobra"
-	"golang.org/x/net/context"
 	"strings"
 )
 
diff --git a/scctl/pkg/plugin/get/schema/schema_cmd.go b/scctl/pkg/plugin/get/schema/schema_cmd.go
index 412dc81..8c1b111 100644
--- a/scctl/pkg/plugin/get/schema/schema_cmd.go
+++ b/scctl/pkg/plugin/get/schema/schema_cmd.go
@@ -16,6 +16,7 @@
 package schema
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
@@ -25,7 +26,6 @@ import (
 	adminModel "github.com/apache/servicecomb-service-center/server/admin/model"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/spf13/cobra"
-	"golang.org/x/net/context"
 	"io"
 	"io/ioutil"
 	"os"
diff --git a/scctl/pkg/plugin/get/service/service_cmd.go b/scctl/pkg/plugin/get/service/service_cmd.go
index 3c63f41..592b49f 100644
--- a/scctl/pkg/plugin/get/service/service_cmd.go
+++ b/scctl/pkg/plugin/get/service/service_cmd.go
@@ -16,6 +16,7 @@
 package service
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
@@ -24,7 +25,6 @@ import (
 	"github.com/apache/servicecomb-service-center/scctl/pkg/writer"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/spf13/cobra"
-	"golang.org/x/net/context"
 	"strings"
 )
 
diff --git a/scctl/pkg/plugin/health/cmd.go b/scctl/pkg/plugin/health/cmd.go
index befbbce..83a029e 100644
--- a/scctl/pkg/plugin/health/cmd.go
+++ b/scctl/pkg/plugin/health/cmd.go
@@ -16,11 +16,11 @@
 package health
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
 	scerr "github.com/apache/servicecomb-service-center/server/error"
 	"github.com/spf13/cobra"
-	"golang.org/x/net/context"
 )
 
 const (
diff --git a/scctl/pkg/plugin/version/cmd.go b/scctl/pkg/plugin/version/cmd.go
index 8492071..a9726b7 100644
--- a/scctl/pkg/plugin/version/cmd.go
+++ b/scctl/pkg/plugin/version/cmd.go
@@ -16,12 +16,12 @@
 package version
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/cmd"
 	"github.com/apache/servicecomb-service-center/scctl/pkg/version"
 	"github.com/spf13/cobra"
-	"golang.org/x/net/context"
 )
 
 var (
diff --git a/scripts/build/deps.sh b/scripts/build/deps.sh
deleted file mode 100644
index 5d477ac..0000000
--- a/scripts/build/deps.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env bash
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-script_path=$(cd "$(dirname "$0")"; pwd)
-
-project_path=$script_path/../..
-
-source $script_path/tools.sh
-
-prepare_env() {
-    local force=${1:-""}
-
-    cd $project_path
-
-    mkdir -p vendor
-
-    if [ "X"$force != "X"-f ]; then
-        if [ ! $(ls vendor | wc -l) -gt 0 ]; then
-            sc_deps
-        fi
-
-        if [ ! -d frontend/app/bower_components ]; then
-            frontend_deps
-        fi
-    else
-        sc_deps
-
-        frontend_deps
-    fi
-}
-
-prepare_env $@
diff --git a/scripts/build/local.sh b/scripts/build/local.sh
index 487a3e1..fee4806 100644
--- a/scripts/build/local.sh
+++ b/scripts/build/local.sh
@@ -34,12 +34,9 @@ script_path=$(cd "$(dirname "$0")"; pwd)
 source ${script_path}/tools.sh
 
 personal_build() {
-    source ${script_path}/deps.sh
 
     build_service_center
 
-    build_frontend
-
     build_scctl
 
     build_syncer
diff --git a/scripts/build/tools.sh b/scripts/build/tools.sh
index bed602e..49d32a7 100644
--- a/scripts/build/tools.sh
+++ b/scripts/build/tools.sh
@@ -22,31 +22,6 @@ fail() {
 	exit 1
 }
 
-install_glide() {
-    set +e
-    GLIDE=$(which glide)
-    if [ "$?" == "1" ]; then
-        set -e
-        curl https://glide.sh/get | sh
-    else
-        set -e
-    fi
-}
-
-install_bower() {
-    set +e
-    BOWER=$(which bower)
-    if [ "$?" == "1" ]; then
-        set -e
-
-        curl -sL https://deb.nodesource.com/setup_8.x | bash -
-        apt-get install -y nodejs
-
-        npm install -g bower
-    else
-        set -e
-    fi
-}
 
 build_service_center() {
     local app=$PACKAGE_PREFIX-$PACKAGE-$GOOS-$GOARCH
@@ -71,16 +46,6 @@ build_service_center() {
     go build --ldflags "${ldflags}" -o $BINARY_NAME
 }
 
-build_frontend() {
-    ## Build Frontend Release
-    cd frontend
-    local BINARY_NAME=$PACKAGE_PREFIX-$PACKAGE-$GOOS-$GOARCH/frontend
-    if [ "$GOOS" == "windows" ]; then
-        BINARY_NAME=${BINARY_NAME}.exe
-    fi
-    go build --ldflags "${GO_LDFLAGS}" -o ../$BINARY_NAME
-    cd -
-}
 
 build_scctl() {
     local app=../$PACKAGE_PREFIX-$PACKAGE-$GOOS-$GOARCH
@@ -116,20 +81,7 @@ build_syncer() {
     cd -
 }
 
-sc_deps() {
-    install_glide
 
-    glide install
-}
-
-frontend_deps() {
-    install_bower
-
-    ## Download the frontend dependencies using bower
-    cd frontend/app
-    bower install --allow-root
-    cd ../..
-}
 
 ## Prepare the Configuration and Make package
 package() {
diff --git a/scripts/ci/formatChecker.sh b/scripts/ci/formatChecker.sh
new file mode 100755
index 0000000..fa37751
--- /dev/null
+++ b/scripts/ci/formatChecker.sh
@@ -0,0 +1,8 @@
+diff -u <(echo -n) <(find . -name "*.go" -not -path "./vendor/*" -not -path ".git/*" | xargs gofmt -s -d)
+if [ $? == 0 ]; then
+	echo "Hurray....all code is formatted properly..."
+	exit 0
+else
+	echo "There is issues's with the code formatting....please run go fmt on your code"
+	exit 1
+fi
diff --git a/scripts/ci/goCycloChecker.sh b/scripts/ci/goCycloChecker.sh
new file mode 100755
index 0000000..113ef99
--- /dev/null
+++ b/scripts/ci/goCycloChecker.sh
@@ -0,0 +1,8 @@
+diff -u <(echo -n) <(find . -name "*.go" -not -path "./vendor/*" -not -path ".git/*" -not -path "./third_party/*" | grep -v _test | xargs gocyclo -over 16)
+if [ $? == 0 ]; then
+	echo "All function has less cyclomatic complexity..."
+	exit 0
+else
+	echo "Functions/function has more cyclomatic complexity..."
+	exit 1
+fi
diff --git a/scripts/ci/misspellChecker.sh b/scripts/ci/misspellChecker.sh
new file mode 100755
index 0000000..7ff9760
--- /dev/null
+++ b/scripts/ci/misspellChecker.sh
@@ -0,0 +1,8 @@
+diff -u <(echo -n) <(find . -type f -not -path "./vendor/*" -not -path "./third_party/*" -print0 | xargs -0 misspell)
+if [ $? == 0 ]; then
+	echo "No Misspell found"
+	exit 0
+else
+	echo "Misspell found"
+	exit 1
+fi
diff --git a/scripts/integration_test.sh b/scripts/integration_test.sh
index 9b4b092..d0138af 100755
--- a/scripts/integration_test.sh
+++ b/scripts/integration_test.sh
@@ -30,7 +30,7 @@ set +e
 docker rm -f etcd
 kill -9 $(ps aux | grep 'service-center' | awk '{print $2}')
 set -e
-docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 40010:40010 -p 23800:23800 -p 2379:2379 --name etcd quay.io/coreos/etcd etcd -name etcd0 -advertise-client-urls http://127.0.0.1:2379,http://127.0.0.1:40010 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:40010 -initial-advertise-peer-urls http://127.0.0.1:23800 -listen-peer-urls http://0.0.0.0:23800 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd0=http://127.0.0.1:23800 -initial-cluster-state new
+sudo docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 40010:40010 -p 23800:23800 -p 2379:2379 --name etcd quay.io/coreos/etcd etcd -name etcd0 -advertise-client-urls http://127.0.0.1:2379,http://127.0.0.1:40010 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:40010 -initial-advertise-peer-urls http://127.0.0.1:23800 -listen-peer-urls http://0.0.0.0:23800 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd0=http://127.0.0.1:23800 -initial-cluster-state new
 while ! nc -z 127.0.0.1 2379; do
   echo "Waiting Etcd to launch on 2379..."
   sleep 1
@@ -59,7 +59,7 @@ if [ $? == 0 ]; then
 else
 	echo "${red}Some or all the integration test failed..please check the logs for more details.${reset}"
 	set +e
-	docker rm -f etcd
+	sudo docker rm -f etcd
 	kill -9 $(ps aux | grep 'service-center' | awk '{print $2}')
 	set -e
 	exit 1
diff --git a/server/admin/admin_suite_test.go b/server/admin/admin_suite_test.go
deleted file mode 100644
index 9c11b87..0000000
--- a/server/admin/admin_suite_test.go
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package admin_test
-
-import _ "github.com/apache/servicecomb-service-center/server/init"
-import _ "github.com/apache/servicecomb-service-center/server/bootstrap"
-import (
-	"github.com/apache/servicecomb-service-center/pkg/util"
-	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"github.com/astaxie/beego"
-	. "github.com/onsi/ginkgo"
-	"github.com/onsi/ginkgo/reporters"
-	. "github.com/onsi/gomega"
-	"golang.org/x/net/context"
-	"testing"
-)
-
-func init() {
-	beego.AppConfig.Set("registry_plugin", "etcd")
-}
-
-func TestAdmin(t *testing.T) {
-	RegisterFailHandler(Fail)
-	junitReporter := reporters.NewJUnitReporter("model.junit.xml")
-	RunSpecsWithDefaultAndCustomReporters(t, "model Suite", []Reporter{junitReporter})
-}
-
-var _ = BeforeSuite(func() {
-	//init plugin
-})
-
-func getContext() context.Context {
-	return util.SetContext(
-		util.SetDomainProject(context.Background(), "default", "default"),
-		serviceUtil.CTX_NOCACHE, "1")
-}
diff --git a/server/admin/service.go b/server/admin/service.go
index 21715fb..a7a9632 100644
--- a/server/admin/service.go
+++ b/server/admin/service.go
@@ -17,6 +17,7 @@
 package admin
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
@@ -30,7 +31,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/apache/servicecomb-service-center/version"
 	"github.com/astaxie/beego"
-	"golang.org/x/net/context"
 	"os"
 	"strings"
 )
diff --git a/server/admin/service_test.go b/server/admin/service_test.go
index b2f1584..feff0be 100644
--- a/server/admin/service_test.go
+++ b/server/admin/service_test.go
@@ -17,33 +17,42 @@
 package admin_test
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/admin"
 	"github.com/apache/servicecomb-service-center/server/admin/model"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	scerr "github.com/apache/servicecomb-service-center/server/error"
-	. "github.com/onsi/ginkgo"
-	. "github.com/onsi/gomega"
-	"golang.org/x/net/context"
+	mgr "github.com/apache/servicecomb-service-center/server/plugin"
+	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery/etcd"
+	etcd2 "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry/etcd"
+	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
+	"github.com/astaxie/beego"
+	"github.com/stretchr/testify/assert"
+	"testing"
 )
 
-var _ = Describe("'Admin' service", func() {
-	Describe("execute 'dump' operation", func() {
-		Context("when get all", func() {
-			It("should be passed", func() {
-				resp, err := admin.AdminServiceAPI.Dump(getContext(), &model.DumpRequest{})
-				Expect(err).To(BeNil())
-				Expect(resp.Response.Code).To(Equal(pb.Response_SUCCESS))
-			})
-		})
-		Context("when get by domain project", func() {
-			It("should be passed", func() {
-				resp, err := admin.AdminServiceAPI.Dump(
-					util.SetDomainProject(context.Background(), "x", "x"),
-					&model.DumpRequest{})
-				Expect(err).To(BeNil())
-				Expect(resp.Response.Code).To(Equal(scerr.ErrForbidden))
-			})
-		})
-	})
-})
+func init() {
+	beego.AppConfig.Set("registry_plugin", "etcd")
+	mgr.RegisterPlugin(mgr.Plugin{mgr.REGISTRY, "etcd", etcd2.NewRegistry})
+	mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "buildin", etcd.NewRepository})
+	mgr.RegisterPlugin(mgr.Plugin{mgr.DISCOVERY, "etcd", etcd.NewRepository})
+}
+func TestAdminService_Dump(t *testing.T) {
+	t.Log("execute 'dump' operation,when get all,should be passed")
+	resp, err := admin.AdminServiceAPI.Dump(getContext(), &model.DumpRequest{})
+	assert.NoError(t, err)
+	assert.Equal(t, pb.Response_SUCCESS, resp.Response.Code)
+	t.Log("execute 'dump' operation,when get by domain project,should be passed")
+	resp, err = admin.AdminServiceAPI.Dump(
+		util.SetDomainProject(context.Background(), "x", "x"),
+		&model.DumpRequest{})
+	assert.NoError(t, err)
+	assert.Equal(t, scerr.ErrForbidden, resp.Response.Code)
+}
+
+func getContext() context.Context {
+	return util.SetContext(
+		util.SetDomainProject(context.Background(), "default", "default"),
+		serviceUtil.CTX_NOCACHE, "1")
+}
diff --git a/server/api.go b/server/api.go
index cf1545b..8811f98 100644
--- a/server/api.go
+++ b/server/api.go
@@ -17,6 +17,7 @@
 package server
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/grace"
@@ -27,7 +28,6 @@ import (
 	rs "github.com/apache/servicecomb-service-center/server/rest"
 	"github.com/apache/servicecomb-service-center/server/rpc"
 	"github.com/apache/servicecomb-service-center/server/service"
-	"golang.org/x/net/context"
 	"net"
 	"strconv"
 )
diff --git a/server/broker/broker_suite_test.go b/server/broker/broker_suite_test.go
index e0b1045..7747d98 100644
--- a/server/broker/broker_suite_test.go
+++ b/server/broker/broker_suite_test.go
@@ -16,7 +16,6 @@
  */
 package broker_test
 
-import _ "github.com/apache/servicecomb-service-center/server/init"
 import _ "github.com/apache/servicecomb-service-center/server/bootstrap"
 import (
 	"github.com/apache/servicecomb-service-center/server/broker"
@@ -31,6 +30,8 @@ import (
 
 func init() {
 	beego.AppConfig.Set("registry_plugin", "etcd")
+	testing.Init()
+	core.Initialize()
 }
 
 var brokerResource = broker.BrokerServiceAPI
diff --git a/server/broker/service.go b/server/broker/service.go
index fb7e637..03d0d84 100644
--- a/server/broker/service.go
+++ b/server/broker/service.go
@@ -24,6 +24,7 @@ import (
 	"strings"
 	"time"
 
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/broker/brokerpb"
@@ -32,7 +33,6 @@ import (
 	scerr "github.com/apache/servicecomb-service-center/server/error"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 var BrokerServiceAPI = &BrokerService{}
diff --git a/server/broker/service_test.go b/server/broker/service_test.go
index 5096753..d9c08f8 100644
--- a/server/broker/service_test.go
+++ b/server/broker/service_test.go
@@ -19,6 +19,7 @@ package broker_test
 import (
 	"fmt"
 
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/broker"
 	"github.com/apache/servicecomb-service-center/server/broker/brokerpb"
@@ -27,7 +28,6 @@ import (
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
-	"golang.org/x/net/context"
 )
 
 const (
@@ -194,9 +194,9 @@ var _ = Describe("BrokerController", func() {
 				Expect(err).To(BeNil())
 				respResults, err := brokerResource.PublishVerificationResults(getContext(),
 					&brokerpb.PublishVerificationRequest{
-						ProviderId: providerServiceId,
-						ConsumerId: consumerServiceId,
-						PactId:     int32(id),
+						ProviderId:                 providerServiceId,
+						ConsumerId:                 consumerServiceId,
+						PactId:                     int32(id),
 						ProviderApplicationVersion: TEST_BROKER_PROVIDER_VERSION,
 					})
 
diff --git a/server/core/backend/defer_instance.go b/server/core/backend/defer_instance.go
index 74faf2d..f828d6d 100644
--- a/server/core/backend/defer_instance.go
+++ b/server/core/backend/defer_instance.go
@@ -17,12 +17,12 @@
 package backend
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
-	"golang.org/x/net/context"
 	"sync"
 	"time"
 )
diff --git a/server/core/backend/discovery.go b/server/core/backend/discovery.go
index b9d096e..1acae3f 100644
--- a/server/core/backend/discovery.go
+++ b/server/core/backend/discovery.go
@@ -17,6 +17,7 @@
 package backend
 
 import (
+	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
@@ -26,7 +27,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"sync"
 	"time"
 )
diff --git a/server/core/backend/discovery_test.go b/server/core/backend/discovery_test.go
index 510d2d1..7f3cf39 100644
--- a/server/core/backend/discovery_test.go
+++ b/server/core/backend/discovery_test.go
@@ -17,11 +17,11 @@
 package backend
 
 import (
+	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/task"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"testing"
 )
 
diff --git a/server/core/backend/lease.go b/server/core/backend/lease.go
index f31737e..442fa6e 100644
--- a/server/core/backend/lease.go
+++ b/server/core/backend/lease.go
@@ -17,12 +17,12 @@
 package backend
 
 import (
+	"context"
 	errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	simple "github.com/apache/servicecomb-service-center/pkg/time"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"time"
 )
 
diff --git a/server/core/backend/lease_test.go b/server/core/backend/lease_test.go
index 863063b..62fd549 100644
--- a/server/core/backend/lease_test.go
+++ b/server/core/backend/lease_test.go
@@ -17,11 +17,11 @@
 package backend
 
 import (
+	"context"
 	"fmt"
 	errorsEx "github.com/apache/servicecomb-service-center/pkg/errors"
 	simple "github.com/apache/servicecomb-service-center/pkg/time"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry/buildin"
-	"golang.org/x/net/context"
 	"testing"
 	"time"
 )
diff --git a/server/core/backend/registry.go b/server/core/backend/registry.go
index 09a88d2..c9e3489 100644
--- a/server/core/backend/registry.go
+++ b/server/core/backend/registry.go
@@ -17,6 +17,7 @@
 package backend
 
 import (
+	"context"
 	"errors"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/backoff"
@@ -26,7 +27,6 @@ import (
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"sync"
 	"time"
 )
diff --git a/server/core/microservice.go b/server/core/microservice.go
index 1a45a0c..9945a5f 100644
--- a/server/core/microservice.go
+++ b/server/core/microservice.go
@@ -17,11 +17,11 @@
 package core
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/version"
 	"github.com/astaxie/beego"
-	"golang.org/x/net/context"
 	"os"
 	"strings"
 )
diff --git a/server/core/microservice_test.go b/server/core/microservice_test.go
index c5133dd..9c418a6 100644
--- a/server/core/microservice_test.go
+++ b/server/core/microservice_test.go
@@ -16,9 +16,9 @@
 package core
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/astaxie/beego"
-	"golang.org/x/net/context"
 	"os"
 	"testing"
 )
diff --git a/server/core/proto/services.go b/server/core/proto/services.go
index a2e6509..8e709da 100644
--- a/server/core/proto/services.go
+++ b/server/core/proto/services.go
@@ -17,8 +17,8 @@
 package proto
 
 import (
+	"context"
 	"github.com/gorilla/websocket"
-	"golang.org/x/net/context"
 )
 
 type ServiceInstanceCtrlServerEx interface {
diff --git a/server/core/proto/services.pb.go b/server/core/proto/services.pb.go
index b7ad422..492d7c8 100644
--- a/server/core/proto/services.pb.go
+++ b/server/core/proto/services.pb.go
@@ -126,7 +126,7 @@ import fmt "fmt"
 import math "math"
 
 import (
-	context "golang.org/x/net/context"
+	context "context"
 	grpc "google.golang.org/grpc"
 )
 
diff --git a/server/govern/govern_suite_test.go b/server/govern/govern_suite_test.go
index 0954f22..9c461ad 100644
--- a/server/govern/govern_suite_test.go
+++ b/server/govern/govern_suite_test.go
@@ -17,9 +17,9 @@
 package govern_test
 
 // initialize
-import _ "github.com/apache/servicecomb-service-center/server/init"
 import _ "github.com/apache/servicecomb-service-center/server/bootstrap"
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/core"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
@@ -30,12 +30,13 @@ import (
 	. "github.com/onsi/ginkgo"
 	"github.com/onsi/ginkgo/reporters"
 	. "github.com/onsi/gomega"
-	"golang.org/x/net/context"
 	"testing"
 )
 
 func init() {
 	beego.AppConfig.Set("registry_plugin", "etcd")
+	testing.Init()
+	core.Initialize()
 }
 
 func TestGovern(t *testing.T) {
diff --git a/server/govern/service.go b/server/govern/service.go
index 31b6552..b03abc8 100644
--- a/server/govern/service.go
+++ b/server/govern/service.go
@@ -17,6 +17,7 @@
 package govern
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
@@ -27,7 +28,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/apache/servicecomb-service-center/server/service"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 var GovernServiceAPI pb.GovernServiceCtrlServer = &GovernService{}
diff --git a/server/handler/metric/metric.go b/server/handler/metric/metric.go
index ec68eb4..1b48ccc 100644
--- a/server/handler/metric/metric.go
+++ b/server/handler/metric/metric.go
@@ -20,6 +20,7 @@ import (
 	"github.com/apache/servicecomb-service-center/pkg/chain"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/rest"
+	"github.com/apache/servicecomb-service-center/server/metric/prometheus"
 	svr "github.com/apache/servicecomb-service-center/server/rest"
 	"net/http"
 	"time"
@@ -36,7 +37,7 @@ func (h *MetricsHandler) Handle(i *chain.Invocation) {
 		}
 		w, r := i.Context().Value(rest.CTX_RESPONSE).(http.ResponseWriter),
 			i.Context().Value(rest.CTX_REQUEST).(*http.Request)
-		svr.ReportRequestCompleted(w, r, start)
+		prometheus.ReportRequestCompleted(w, r, start)
 		log.LogNilOrWarnf(start, "%s %s", r.Method, r.RequestURI)
 	}))
 }
diff --git a/server/health/metrics.go b/server/health/metrics.go
index 4c49fe7..79e0d6a 100644
--- a/server/health/metrics.go
+++ b/server/health/metrics.go
@@ -16,11 +16,11 @@
 package health
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/metric"
 	"github.com/prometheus/client_golang/prometheus"
-	"golang.org/x/net/context"
 	"runtime"
 	"time"
 )
diff --git a/server/metric/gatherer.go b/server/metric/gatherer.go
index 48a1eed..81b6738 100644
--- a/server/metric/gatherer.go
+++ b/server/metric/gatherer.go
@@ -17,10 +17,10 @@
 package metric
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
-	pm "github.com/prometheus/client_golang/prometheus"
-	"golang.org/x/net/context"
+	"github.com/prometheus/client_golang/prometheus"
 	"strings"
 	"sync"
 	"time"
@@ -79,7 +79,7 @@ func (mm *MetricsGatherer) loop(ctx context.Context) {
 }
 
 func (mm *MetricsGatherer) Collect() error {
-	mfs, err := pm.DefaultGatherer.Gather()
+	mfs, err := prometheus.DefaultGatherer.Gather()
 	if err != nil {
 		return err
 	}
diff --git a/server/rest/metrics.go b/server/metric/prometheus/metrics.go
similarity index 95%
rename from server/rest/metrics.go
rename to server/metric/prometheus/metrics.go
index 821155c..f0f5f19 100644
--- a/server/rest/metrics.go
+++ b/server/metric/prometheus/metrics.go
@@ -14,12 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package rest
+package prometheus
 
 import (
 	"github.com/apache/servicecomb-service-center/pkg/rest"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/metric"
+	rest2 "github.com/apache/servicecomb-service-center/server/rest"
 	"github.com/prometheus/client_golang/prometheus"
 	"net/http"
 	"strconv"
@@ -65,7 +66,7 @@ var (
 func init() {
 	prometheus.MustRegister(incomingRequests, successfulRequests, reqDurations, queryPerSeconds)
 
-	RegisterServerHandler("/metrics", prometheus.Handler())
+	rest2.RegisterServerHandler("/metrics", prometheus.Handler())
 }
 
 func ReportRequestCompleted(w http.ResponseWriter, r *http.Request, start time.Time) {
diff --git a/server/rest/reporter.go b/server/metric/prometheus/reporter.go
similarity index 99%
rename from server/rest/reporter.go
rename to server/metric/prometheus/reporter.go
index 6c4e291..32cc6df 100644
--- a/server/rest/reporter.go
+++ b/server/metric/prometheus/reporter.go
@@ -13,7 +13,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package rest
+package prometheus
 
 import (
 	"github.com/apache/servicecomb-service-center/server/metric"
diff --git a/server/metric/reporter.go b/server/metric/reporter.go
index 7f8baf3..f86b9f2 100644
--- a/server/metric/reporter.go
+++ b/server/metric/reporter.go
@@ -25,11 +25,6 @@ type Reporter interface {
 	Report()
 }
 
-type noopReporter struct {
-}
-
-func (*noopReporter) Report() {}
-
 func RegisterReporter(name string, r Reporter) {
 	reporters[name] = r
 	log.Infof("register metrics reporter '%s'", name)
diff --git a/server/mux/mux.go b/server/mux/mux.go
index c2c844e..4944d1b 100644
--- a/server/mux/mux.go
+++ b/server/mux/mux.go
@@ -39,9 +39,9 @@ const (
 )
 
 func Lock(t MuxType) (*etcdsync.DLock, error) {
-	return etcdsync.Lock(t.String(), true)
+	return etcdsync.Lock(t.String(), -1, true)
 }
 
 func Try(t MuxType) (*etcdsync.DLock, error) {
-	return etcdsync.Lock(t.String(), false)
+	return etcdsync.Lock(t.String(), -1, false)
 }
diff --git a/server/notify/listwatcher.go b/server/notify/listwatcher.go
index b5c5394..e355492 100644
--- a/server/notify/listwatcher.go
+++ b/server/notify/listwatcher.go
@@ -17,12 +17,12 @@
 package notify
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/notify"
 	simple "github.com/apache/servicecomb-service-center/pkg/time"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
-	"golang.org/x/net/context"
 	"time"
 )
 
diff --git a/server/notify/publisher.go b/server/notify/publisher.go
index fc0d703..7970192 100644
--- a/server/notify/publisher.go
+++ b/server/notify/publisher.go
@@ -17,8 +17,8 @@
 package notify
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
-	"golang.org/x/net/context"
 	"sync"
 	"time"
 )
diff --git a/server/notify/stream.go b/server/notify/stream.go
index 8d2f1b4..705323b 100644
--- a/server/notify/stream.go
+++ b/server/notify/stream.go
@@ -17,12 +17,12 @@
 package notify
 
 import (
+	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	apt "github.com/apache/servicecomb-service-center/server/core"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
-	"golang.org/x/net/context"
 	"time"
 )
 
diff --git a/server/notify/stream_test.go b/server/notify/stream_test.go
index 3280bf6..1c7694f 100644
--- a/server/notify/stream_test.go
+++ b/server/notify/stream_test.go
@@ -17,10 +17,10 @@
 package notify
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	simple "github.com/apache/servicecomb-service-center/pkg/time"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
-	"golang.org/x/net/context"
 	"google.golang.org/grpc"
 	"testing"
 	"time"
diff --git a/server/notify/websocket.go b/server/notify/websocket.go
index 16e8d21..48acc39 100644
--- a/server/notify/websocket.go
+++ b/server/notify/websocket.go
@@ -17,6 +17,7 @@
 package notify
 
 import (
+	"context"
 	"encoding/json"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
@@ -24,7 +25,6 @@ import (
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 	"github.com/gorilla/websocket"
-	"golang.org/x/net/context"
 	"time"
 )
 
diff --git a/server/notify/websocket_test.go b/server/notify/websocket_test.go
index 6d1c7ce..fc8be6d 100644
--- a/server/notify/websocket_test.go
+++ b/server/notify/websocket_test.go
@@ -16,10 +16,10 @@
  */
 package notify
 
-import _ "github.com/apache/servicecomb-service-center/server/init"
 import (
 	"context"
 	"errors"
+	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
 	_ "github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery/etcd"
 	_ "github.com/apache/servicecomb-service-center/server/plugin/pkg/registry/buildin"
@@ -36,6 +36,10 @@ var closeCh = make(chan struct{})
 type watcherConn struct {
 }
 
+func init() {
+	testing.Init()
+	core.Initialize()
+}
 func (h *watcherConn) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 	var upgrader = websocket.Upgrader{}
 	conn, _ := upgrader.Upgrade(w, r, nil)
diff --git a/server/plugin/pkg/discovery/aggregate/conflict_checker.go b/server/plugin/pkg/discovery/aggregate/conflict_checker.go
index d4a033b..26da49d 100644
--- a/server/plugin/pkg/discovery/aggregate/conflict_checker.go
+++ b/server/plugin/pkg/discovery/aggregate/conflict_checker.go
@@ -16,11 +16,11 @@
 package aggregate
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"time"
 )
 
diff --git a/server/plugin/pkg/discovery/aggregate/indexer.go b/server/plugin/pkg/discovery/aggregate/indexer.go
index 6117d52..d44fd14 100644
--- a/server/plugin/pkg/discovery/aggregate/indexer.go
+++ b/server/plugin/pkg/discovery/aggregate/indexer.go
@@ -20,7 +20,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 // AdaptorsIndexer implements discovery.Indexer.
diff --git a/server/plugin/pkg/discovery/etcd/cacher_kv.go b/server/plugin/pkg/discovery/etcd/cacher_kv.go
index b14830d..d06de32 100644
--- a/server/plugin/pkg/discovery/etcd/cacher_kv.go
+++ b/server/plugin/pkg/discovery/etcd/cacher_kv.go
@@ -17,6 +17,7 @@
 package etcd
 
 import (
+	"context"
 	"errors"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/backoff"
@@ -29,7 +30,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/coreos/etcd/mvcc/mvccpb"
-	"golang.org/x/net/context"
 	"sync"
 	"time"
 )
diff --git a/server/plugin/pkg/discovery/etcd/cacher_kv_test.go b/server/plugin/pkg/discovery/etcd/cacher_kv_test.go
index dea9d41..bbc1c2f 100644
--- a/server/plugin/pkg/discovery/etcd/cacher_kv_test.go
+++ b/server/plugin/pkg/discovery/etcd/cacher_kv_test.go
@@ -17,6 +17,7 @@
 package etcd
 
 import (
+	"context"
 	"encoding/json"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
@@ -25,7 +26,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/coreos/etcd/mvcc/mvccpb"
-	"golang.org/x/net/context"
 	"math/rand"
 	"strconv"
 	"testing"
diff --git a/server/plugin/pkg/discovery/etcd/indexer_cache.go b/server/plugin/pkg/discovery/etcd/indexer_cache.go
index 66ea6e9..be9cd67 100644
--- a/server/plugin/pkg/discovery/etcd/indexer_cache.go
+++ b/server/plugin/pkg/discovery/etcd/indexer_cache.go
@@ -23,7 +23,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 // CacheIndexer implements discovery.Indexer.
diff --git a/server/plugin/pkg/discovery/etcd/indexer_etcd.go b/server/plugin/pkg/discovery/etcd/indexer_etcd.go
index 5b06782..0f5d4d8 100644
--- a/server/plugin/pkg/discovery/etcd/indexer_etcd.go
+++ b/server/plugin/pkg/discovery/etcd/indexer_etcd.go
@@ -27,7 +27,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 // EtcdIndexer implements discovery.Indexer.
diff --git a/server/plugin/pkg/discovery/etcd/listwatch.go b/server/plugin/pkg/discovery/etcd/listwatch.go
index a98cbff..ac817ef 100644
--- a/server/plugin/pkg/discovery/etcd/listwatch.go
+++ b/server/plugin/pkg/discovery/etcd/listwatch.go
@@ -17,9 +17,9 @@
 package etcd
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"time"
 )
 
diff --git a/server/plugin/pkg/discovery/etcd/listwatch_inner.go b/server/plugin/pkg/discovery/etcd/listwatch_inner.go
index a0b9b2a..153f41d 100644
--- a/server/plugin/pkg/discovery/etcd/listwatch_inner.go
+++ b/server/plugin/pkg/discovery/etcd/listwatch_inner.go
@@ -17,10 +17,10 @@
 package etcd
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 type innerListWatch struct {
diff --git a/server/plugin/pkg/discovery/etcd/listwatch_test.go b/server/plugin/pkg/discovery/etcd/listwatch_test.go
index 96cf0ea..75c9283 100644
--- a/server/plugin/pkg/discovery/etcd/listwatch_test.go
+++ b/server/plugin/pkg/discovery/etcd/listwatch_test.go
@@ -17,11 +17,11 @@
 package etcd
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry/buildin"
 	"github.com/coreos/etcd/mvcc/mvccpb"
-	"golang.org/x/net/context"
 	"testing"
 	"time"
 )
diff --git a/server/plugin/pkg/discovery/etcd/watcher_inner.go b/server/plugin/pkg/discovery/etcd/watcher_inner.go
index e8887a9..aa1d40b 100644
--- a/server/plugin/pkg/discovery/etcd/watcher_inner.go
+++ b/server/plugin/pkg/discovery/etcd/watcher_inner.go
@@ -17,10 +17,10 @@
 package etcd
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"sync"
 )
 
diff --git a/server/plugin/pkg/discovery/etcd/watcher_test.go b/server/plugin/pkg/discovery/etcd/watcher_test.go
index bf3f91d..a5f47b1 100644
--- a/server/plugin/pkg/discovery/etcd/watcher_test.go
+++ b/server/plugin/pkg/discovery/etcd/watcher_test.go
@@ -17,9 +17,9 @@
 package etcd
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"testing"
 	"time"
 )
diff --git a/server/plugin/pkg/discovery/indexer.go b/server/plugin/pkg/discovery/indexer.go
index b21c65b..fa1742e 100644
--- a/server/plugin/pkg/discovery/indexer.go
+++ b/server/plugin/pkg/discovery/indexer.go
@@ -19,7 +19,7 @@ package discovery
 import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 // Indexer searches k-v data.
diff --git a/server/plugin/pkg/discovery/indexer_cache.go b/server/plugin/pkg/discovery/indexer_cache.go
index 7641a7b..988b20d 100644
--- a/server/plugin/pkg/discovery/indexer_cache.go
+++ b/server/plugin/pkg/discovery/indexer_cache.go
@@ -23,7 +23,7 @@ import (
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 // CacheIndexer implements discovery.Indexer.
diff --git a/server/plugin/pkg/discovery/indexer_test.go b/server/plugin/pkg/discovery/indexer_test.go
index ce97bc3..d421719 100644
--- a/server/plugin/pkg/discovery/indexer_test.go
+++ b/server/plugin/pkg/discovery/indexer_test.go
@@ -16,8 +16,8 @@
 package discovery
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"testing"
 )
 
diff --git a/server/plugin/pkg/discovery/k8s/adaptor/common.go b/server/plugin/pkg/discovery/k8s/adaptor/common.go
index b1fafd8..f4bf365 100644
--- a/server/plugin/pkg/discovery/k8s/adaptor/common.go
+++ b/server/plugin/pkg/discovery/k8s/adaptor/common.go
@@ -16,12 +16,12 @@
 package adaptor
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/queue"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/core"
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/uuid"
-	"golang.org/x/net/context"
 	"k8s.io/api/core/v1"
 	meta "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/apimachinery/pkg/types"
diff --git a/server/plugin/pkg/discovery/k8s/adaptor/kube_client.go b/server/plugin/pkg/discovery/k8s/adaptor/kube_client.go
index 9569742..c92f73e 100644
--- a/server/plugin/pkg/discovery/k8s/adaptor/kube_client.go
+++ b/server/plugin/pkg/discovery/k8s/adaptor/kube_client.go
@@ -16,12 +16,12 @@
 package adaptor
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/alarm"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
-	"golang.org/x/net/context"
 	"k8s.io/api/core/v1"
 	"k8s.io/client-go/informers"
 	"k8s.io/client-go/kubernetes"
diff --git a/server/plugin/pkg/discovery/k8s/adaptor/listwatcher.go b/server/plugin/pkg/discovery/k8s/adaptor/listwatcher.go
index 864ab3c..19df74c 100644
--- a/server/plugin/pkg/discovery/k8s/adaptor/listwatcher.go
+++ b/server/plugin/pkg/discovery/k8s/adaptor/listwatcher.go
@@ -16,9 +16,9 @@
 package adaptor
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/queue"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
-	"golang.org/x/net/context"
 	"k8s.io/client-go/tools/cache"
 	"reflect"
 )
diff --git a/server/plugin/pkg/discovery/servicecenter/aggregate.go b/server/plugin/pkg/discovery/servicecenter/aggregate.go
index b9fd9c8..f7b5acb 100644
--- a/server/plugin/pkg/discovery/servicecenter/aggregate.go
+++ b/server/plugin/pkg/discovery/servicecenter/aggregate.go
@@ -16,6 +16,7 @@
 package servicecenter
 
 import (
+	"context"
 	"crypto/tls"
 	"github.com/apache/servicecomb-service-center/pkg/client/sc"
 	"github.com/apache/servicecomb-service-center/pkg/log"
@@ -26,7 +27,6 @@ import (
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"strings"
 	"sync"
 )
diff --git a/server/plugin/pkg/discovery/servicecenter/aggregate_test.go b/server/plugin/pkg/discovery/servicecenter/aggregate_test.go
index 3cf6c5c..b13014f 100644
--- a/server/plugin/pkg/discovery/servicecenter/aggregate_test.go
+++ b/server/plugin/pkg/discovery/servicecenter/aggregate_test.go
@@ -22,7 +22,7 @@ import (
 
 func TestNewSCClientAggregate(t *testing.T) {
 	registry.Configuration().ClusterAddresses = "sc-1=127.0.0.1:2379,127.0.0.2:2379"
-	registry.Configuration().InitClusters()
+	registry.Configuration().InitClusterInfo()
 	c := GetOrCreateSCClient()
 	if len(*c) == 0 {
 		t.Fatalf("TestNewSCClientAggregate failed")
diff --git a/server/plugin/pkg/discovery/servicecenter/indexer.go b/server/plugin/pkg/discovery/servicecenter/indexer.go
index a37fb6d..8b96d47 100644
--- a/server/plugin/pkg/discovery/servicecenter/indexer.go
+++ b/server/plugin/pkg/discovery/servicecenter/indexer.go
@@ -25,7 +25,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 // ClusterIndexer implements discovery.Indexer.
diff --git a/server/plugin/pkg/discovery/servicecenter/syncer.go b/server/plugin/pkg/discovery/servicecenter/syncer.go
index 6cedcf2..925760c 100644
--- a/server/plugin/pkg/discovery/servicecenter/syncer.go
+++ b/server/plugin/pkg/discovery/servicecenter/syncer.go
@@ -31,7 +31,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 var (
diff --git a/server/plugin/pkg/quota/buildin/buildin.go b/server/plugin/pkg/quota/buildin/buildin.go
index 6d5f147..7634080 100644
--- a/server/plugin/pkg/quota/buildin/buildin.go
+++ b/server/plugin/pkg/quota/buildin/buildin.go
@@ -17,11 +17,11 @@
 package buildin
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/quota"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/quota/counter"
-	"golang.org/x/net/context"
 )
 
 func init() {
diff --git a/server/plugin/pkg/quota/buildin/common.go b/server/plugin/pkg/quota/buildin/common.go
index 6e47136..58e6185 100644
--- a/server/plugin/pkg/quota/buildin/common.go
+++ b/server/plugin/pkg/quota/buildin/common.go
@@ -17,6 +17,7 @@
 package buildin
 
 import (
+	"context"
 	"errors"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
@@ -28,7 +29,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/quota"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 type GetCurUsedNum func(context.Context, *quota.ApplyQuotaResource) (int64, error)
diff --git a/server/plugin/pkg/quota/buildin/common_test.go b/server/plugin/pkg/quota/buildin/common_test.go
index 7a2623c..6cb6050 100644
--- a/server/plugin/pkg/quota/buildin/common_test.go
+++ b/server/plugin/pkg/quota/buildin/common_test.go
@@ -16,9 +16,9 @@
 package buildin
 
 import (
+	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/quota"
-	"golang.org/x/net/context"
 	"testing"
 )
 
diff --git a/server/plugin/pkg/quota/counter/event.go b/server/plugin/pkg/quota/counter/event.go
index 533f021..e002ad5 100644
--- a/server/plugin/pkg/quota/counter/event.go
+++ b/server/plugin/pkg/quota/counter/event.go
@@ -16,6 +16,7 @@
 package counter
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/core"
@@ -24,7 +25,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 	"github.com/astaxie/beego"
-	"golang.org/x/net/context"
 )
 
 var (
diff --git a/server/plugin/pkg/quota/quota.go b/server/plugin/pkg/quota/quota.go
index dd75439..1f0f41d 100644
--- a/server/plugin/pkg/quota/quota.go
+++ b/server/plugin/pkg/quota/quota.go
@@ -17,9 +17,9 @@
 package quota
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	scerr "github.com/apache/servicecomb-service-center/server/error"
-	"golang.org/x/net/context"
 	"strconv"
 )
 
diff --git a/server/plugin/pkg/quota/unlimit/unlimit.go b/server/plugin/pkg/quota/unlimit/unlimit.go
index 2ae38ec..9d56ac2 100644
--- a/server/plugin/pkg/quota/unlimit/unlimit.go
+++ b/server/plugin/pkg/quota/unlimit/unlimit.go
@@ -17,11 +17,11 @@
 package unlimit
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/quota"
 	"github.com/astaxie/beego"
-	"golang.org/x/net/context"
 )
 
 func init() {
diff --git a/server/plugin/pkg/registry/buildin/buildin.go b/server/plugin/pkg/registry/buildin/buildin.go
index 0932a6d..5fcc83f 100644
--- a/server/plugin/pkg/registry/buildin/buildin.go
+++ b/server/plugin/pkg/registry/buildin/buildin.go
@@ -17,9 +17,9 @@
 package buildin
 
 import (
+	"context"
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 var (
diff --git a/server/plugin/pkg/registry/common.go b/server/plugin/pkg/registry/common.go
index 0c41e35..2fa4cbc 100644
--- a/server/plugin/pkg/registry/common.go
+++ b/server/plugin/pkg/registry/common.go
@@ -16,7 +16,7 @@
 package registry
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"time"
 )
 
diff --git a/server/plugin/pkg/registry/config.go b/server/plugin/pkg/registry/config.go
index ef36bad..1a0d0b0 100644
--- a/server/plugin/pkg/registry/config.go
+++ b/server/plugin/pkg/registry/config.go
@@ -40,7 +40,8 @@ type Config struct {
 	AutoSyncInterval time.Duration `json:"autoSyncInterval"`
 }
 
-func (c *Config) InitClusters() {
+//InitClusterInfo re-org address info with node name
+func (c *Config) InitClusterInfo() {
 	c.Clusters = make(Clusters)
 	// sc-0=http(s)://host1:port1,http(s)://host2:port2,sc-1=http(s)://host3:port3
 	kvs := strings.Split(c.ClusterAddresses, "=")
@@ -86,7 +87,7 @@ func Configuration() *Config {
 		defaultRegistryConfig.ClusterName = beego.AppConfig.DefaultString("manager_name", DefaultClusterName)
 		defaultRegistryConfig.ManagerAddress = beego.AppConfig.String("manager_addr")
 		defaultRegistryConfig.ClusterAddresses = beego.AppConfig.DefaultString("manager_cluster", "http://127.0.0.1:2379")
-		defaultRegistryConfig.InitClusters()
+		defaultRegistryConfig.InitClusterInfo()
 
 		registryAddresses := strings.Join(defaultRegistryConfig.RegistryAddresses(), ",")
 		defaultRegistryConfig.SslEnabled = core.ServerInfo.Config.SslEnabled &&
diff --git a/server/plugin/pkg/registry/embededetcd/embededetcd.go b/server/plugin/pkg/registry/embededetcd/embededetcd.go
index aeef346..97938a0 100644
--- a/server/plugin/pkg/registry/embededetcd/embededetcd.go
+++ b/server/plugin/pkg/registry/embededetcd/embededetcd.go
@@ -17,6 +17,7 @@
 package embededetcd
 
 import (
+	"context"
 	"crypto/tls"
 	"errors"
 	"fmt"
@@ -33,7 +34,6 @@ import (
 	"github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/lease"
 	"github.com/coreos/etcd/mvcc/mvccpb"
-	"golang.org/x/net/context"
 	"net/url"
 	"strings"
 	"time"
diff --git a/server/plugin/pkg/registry/etcd/etcd.go b/server/plugin/pkg/registry/etcd/etcd.go
index 2bcadd1..0031c76 100644
--- a/server/plugin/pkg/registry/etcd/etcd.go
+++ b/server/plugin/pkg/registry/etcd/etcd.go
@@ -34,11 +34,11 @@ import (
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
+	"context"
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
 	"github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/mvcc/mvccpb"
-	"golang.org/x/net/context"
 )
 
 var firstEndpoint string
@@ -718,38 +718,35 @@ func (c *EtcdClient) HealthCheck() {
 }
 
 func (c *EtcdClient) healthCheckLoop(pctx context.Context) {
-	retries, start := healthCheckRetryTimes, time.Now()
-hcLoop:
+	retries, start := 0, time.Now()
+	d := c.AutoSyncInterval
 	for {
 		select {
 		case <-pctx.Done():
 			return
-		case <-time.After(c.AutoSyncInterval):
+		case <-time.After(d):
 			var err error
-			for i := 0; i < retries; i++ {
-				ctx, _ := context.WithTimeout(c.Client.Ctx(), healthCheckTimeout)
-				if err = c.SyncMembers(ctx); err != nil {
-					d := backoff.GetBackoff().Delay(i)
-					log.Errorf(err, "retry to sync members from etcd %s after %s", c.Endpoints, d)
-					select {
-					case <-pctx.Done():
-						return
-					case <-time.After(d):
-						continue
-					}
+			ctx, _ := context.WithTimeout(c.Client.Ctx(), healthCheckTimeout)
+			if err = c.SyncMembers(ctx); err != nil {
+				d := backoff.GetBackoff().Delay(retries)
+				retries++
+				log.Errorf(err, "retry to sync members from etcd %s after %s", c.Endpoints, d)
+				select {
+				case <-pctx.Done():
+					return
+				default:
+					continue
 				}
-
-				alarm.Clear(alarm.IdBackendConnectionRefuse)
-
-				retries, start = healthCheckRetryTimes, time.Now()
-				continue hcLoop
-			}
-
-			retries = 1 // fail fast
-			if cerr := c.ReOpen(); cerr != nil {
-				log.Errorf(cerr, "retry to health check etcd %s after %s", c.Endpoints, c.AutoSyncInterval)
 			} else {
-				log.Infof("[%s]re-connected to etcd %s", time.Now().Sub(start), c.Endpoints)
+				log.Info("sync members ok.")
+				alarm.Clear(alarm.IdBackendConnectionRefuse)
+				if cerr := c.ReOpen(); cerr != nil {
+					log.Errorf(cerr, "retry to health check etcd %s after %s", c.Endpoints, c.AutoSyncInterval)
+				} else {
+					log.Infof("[%s]re-connected to etcd %s", time.Now().Sub(start), c.Endpoints)
+					continue
+				}
+				return
 			}
 		}
 	}
diff --git a/server/plugin/pkg/registry/etcd/etcd_test.go b/server/plugin/pkg/registry/etcd/etcd_test.go
index 988c0ce..e8f484c 100644
--- a/server/plugin/pkg/registry/etcd/etcd_test.go
+++ b/server/plugin/pkg/registry/etcd/etcd_test.go
@@ -16,7 +16,10 @@
  */
 package etcd
 
-import _ "github.com/apache/servicecomb-service-center/server/plugin/pkg/tracing/buildin"
+import (
+	_ "github.com/apache/servicecomb-service-center/server/plugin/pkg/tracing/buildin"
+	"github.com/stretchr/testify/assert"
+)
 import _ "github.com/apache/servicecomb-service-center/server/plugin/pkg/security/buildin"
 import _ "github.com/apache/servicecomb-service-center/server/plugin/pkg/tls/buildin"
 import (
@@ -33,10 +36,10 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/apache/servicecomb-service-center/server/rpc"
 
+	"context"
 	"github.com/coreos/etcd/clientv3"
 	"github.com/coreos/etcd/etcdserver/etcdserverpb"
 	"github.com/coreos/etcd/mvcc/mvccpb"
-	"golang.org/x/net/context"
 	"google.golang.org/grpc/status"
 )
 
@@ -49,19 +52,24 @@ var (
 )
 
 func TestInitCluster(t *testing.T) {
-	registry.Configuration().ClusterAddresses = "127.0.0.1:2379"
-	registry.Configuration().InitClusters()
-	if strings.Join(registry.Configuration().RegistryAddresses(), ",") != "127.0.0.1:2379" {
-		t.Fatalf("TestInitCluster failed, %v", registry.Configuration().RegistryAddresses())
-	}
-	registry.Configuration().ClusterAddresses = "127.0.0.1:2379,127.0.0.2:2379"
-	registry.Configuration().InitClusters()
-	if strings.Join(registry.Configuration().RegistryAddresses(), ",") != "127.0.0.1:2379,127.0.0.2:2379" {
-		t.Fatalf("TestInitCluster failed, %v", registry.Configuration().RegistryAddresses())
-	}
+	t.Run("normal", func(t *testing.T) {
+		registry.Configuration().ClusterAddresses = "127.0.0.1:2379"
+		registry.Configuration().InitClusterInfo()
+		if strings.Join(registry.Configuration().RegistryAddresses(), ",") != "127.0.0.1:2379" {
+			t.Fatalf("TestInitCluster failed, %v", registry.Configuration().RegistryAddresses())
+		}
+	})
+	t.Run("not normal2", func(t *testing.T) {
+		registry.Configuration().ClusterAddresses = "127.0.0.1:2379,127.0.0.2:2379"
+		registry.Configuration().InitClusterInfo()
+		if strings.Join(registry.Configuration().RegistryAddresses(), ",") != "127.0.0.1:2379,127.0.0.2:2379" {
+			t.Fatalf("TestInitCluster failed, %v", registry.Configuration().RegistryAddresses())
+		}
+	})
+
 	registry.Configuration().ClusterName = "sc-0"
 	registry.Configuration().ClusterAddresses = "sc-0=127.0.0.1:2379,127.0.0.2:2379"
-	registry.Configuration().InitClusters()
+	registry.Configuration().InitClusterInfo()
 	if strings.Join(registry.Configuration().RegistryAddresses(), ",") != "127.0.0.1:2379,127.0.0.2:2379" {
 		t.Fatalf("TestInitCluster failed, %v", registry.Configuration().RegistryAddresses())
 	}
@@ -70,7 +78,7 @@ func TestInitCluster(t *testing.T) {
 	}
 	registry.Configuration().ClusterName = "sc-0"
 	registry.Configuration().ClusterAddresses = "sc-1=127.0.0.1:2379,127.0.0.2:2379,sc-2=127.0.0.3:2379"
-	registry.Configuration().InitClusters()
+	registry.Configuration().InitClusterInfo()
 	if strings.Join(registry.Configuration().RegistryAddresses(), ",") != "" {
 		t.Fatalf("TestInitCluster failed, %v", registry.Configuration().RegistryAddresses())
 	}
@@ -82,7 +90,7 @@ func TestInitCluster(t *testing.T) {
 	}
 	registry.Configuration().ClusterName = "sc-0"
 	registry.Configuration().ClusterAddresses = "sc-0=127.0.0.1:2379,sc-1=127.0.0.3:2379,127.0.0.4:2379"
-	registry.Configuration().InitClusters()
+	registry.Configuration().InitClusterInfo()
 	if strings.Join(registry.Configuration().RegistryAddresses(), ",") != "127.0.0.1:2379" {
 		t.Fatalf("TestInitCluster failed, %v", registry.Configuration().RegistryAddresses())
 	}
@@ -92,7 +100,7 @@ func TestInitCluster(t *testing.T) {
 	registry.Configuration().ClusterName = "sc-0"
 	registry.Configuration().ManagerAddress = "127.0.0.1:2379,127.0.0.2:2379"
 	registry.Configuration().ClusterAddresses = "sc-0=127.0.0.1:30100,sc-1=127.0.0.2:30100"
-	registry.Configuration().InitClusters()
+	registry.Configuration().InitClusterInfo()
 	if strings.Join(registry.Configuration().RegistryAddresses(), ",") != "127.0.0.1:2379,127.0.0.2:2379" {
 		t.Fatalf("TestInitCluster failed, %v", registry.Configuration().RegistryAddresses())
 	}
@@ -105,20 +113,20 @@ func TestEtcdClient(t *testing.T) {
 	registry.Configuration().ClusterName = ""
 	registry.Configuration().ManagerAddress = ""
 	registry.Configuration().ClusterAddresses = endpoint
-	registry.Configuration().InitClusters()
+	registry.Configuration().InitClusterInfo()
 
-	etcd := &EtcdClient{
+	etcdc := &EtcdClient{
 		Endpoints:   []string{endpoint},
 		DialTimeout: dialTimeout,
 	}
-	err := etcd.Initialize()
+	err := etcdc.Initialize()
 	if err != nil {
 		t.Fatalf("TestEtcdClient failed, %#v", err)
 	}
-	defer etcd.Close()
+	defer etcdc.Close()
 
 	select {
-	case <-etcd.Ready():
+	case <-etcdc.Ready():
 	default:
 		t.Fatalf("TestEtcdClient failed")
 	}
@@ -131,7 +139,7 @@ func TestEtcdClient(t *testing.T) {
 	old1 := registry.Configuration().ClusterAddresses
 	old2 := registry.Configuration().DialTimeout
 	registry.Configuration().ClusterAddresses = "x"
-	registry.Configuration().InitClusters()
+	registry.Configuration().InitClusterInfo()
 	registry.Configuration().DialTimeout = dialTimeout
 	inst = NewRegistry()
 	if inst == nil {
@@ -143,76 +151,76 @@ func TestEtcdClient(t *testing.T) {
 		t.Fatalf("TestEtcdClient failed, %#v", err)
 	}
 	registry.Configuration().ClusterAddresses = old1
-	registry.Configuration().InitClusters()
+	registry.Configuration().InitClusterInfo()
 	registry.Configuration().DialTimeout = old2
 
-	// case: etcd do
+	// case: etcdc do
 	// put
-	resp, err := etcd.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/b"),
+	resp, err := etcdc.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/b"),
 		registry.WithStrValue("b"))
 	if err != nil || !resp.Succeeded {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/b"))
+	resp, err = etcdc.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/b"))
 	if err != nil || !resp.Succeeded || resp.Count != 1 ||
 		string(resp.Kvs[0].Key) != "/test_range/b" || string(resp.Kvs[0].Value) != "b" {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 
-	resp, err = etcd.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/a"),
+	resp, err = etcdc.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/a"),
 		registry.WithStrValue("a"))
 	if err != nil || !resp.Succeeded {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/a"),
+	resp, err = etcdc.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/a"),
 		registry.WithKeyOnly())
 	if err != nil || !resp.Succeeded || resp.Count != 1 ||
 		string(resp.Kvs[0].Key) != "/test_range/a" || resp.Kvs[0].Value != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/a"),
+	resp, err = etcdc.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/a"),
 		registry.WithCountOnly())
 	if err != nil || !resp.Succeeded || resp.Count != 1 || resp.Kvs != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 
-	resp, err = etcd.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/c"),
+	resp, err = etcdc.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/c"),
 		registry.WithStrValue("c"))
 	if err != nil || !resp.Succeeded {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/d"),
+	resp, err = etcdc.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/d"),
 		registry.WithStrValue("d"))
 	if err != nil || !resp.Succeeded {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/dd"),
+	resp, err = etcdc.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_range/dd"),
 		registry.WithStrValue("dd"))
 	if err != nil || !resp.Succeeded {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 	// get prefix
-	resp, err = etcd.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/d"),
+	resp, err = etcdc.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/d"),
 		registry.WithPrefix())
 	if err != nil || !resp.Succeeded || resp.Count != 2 ||
 		string(resp.Kvs[0].Key) != "/test_range/d" || string(resp.Kvs[0].Value) != "d" ||
 		string(resp.Kvs[1].Key) != "/test_range/dd" || string(resp.Kvs[1].Value) != "dd" {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/d"),
+	resp, err = etcdc.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/d"),
 		registry.WithPrefix(), registry.WithKeyOnly())
 	if err != nil || !resp.Succeeded || resp.Count != 2 ||
 		string(resp.Kvs[0].Key) != "/test_range/d" || resp.Kvs[0].Value != nil ||
 		string(resp.Kvs[1].Key) != "/test_range/dd" || resp.Kvs[1].Value != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/d"),
+	resp, err = etcdc.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/d"),
 		registry.WithPrefix(), registry.WithCountOnly())
 	if err != nil || !resp.Succeeded || resp.Count != 2 || resp.Kvs != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 	// get range
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/b"),
 		registry.WithStrEndKey("/test_range/dd")) // [b, dd) !!!
 	if err != nil || !resp.Succeeded || resp.Count != 3 ||
@@ -221,7 +229,7 @@ func TestEtcdClient(t *testing.T) {
 		string(resp.Kvs[2].Key) != "/test_range/d" || string(resp.Kvs[2].Value) != "d" {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/b"),
 		registry.WithStrEndKey("/test_range/dd"), registry.WithKeyOnly()) // [b, dd) !!!
 	if err != nil || !resp.Succeeded || resp.Count != 3 ||
@@ -230,14 +238,14 @@ func TestEtcdClient(t *testing.T) {
 		string(resp.Kvs[2].Key) != "/test_range/d" || resp.Kvs[2].Value != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/b"),
 		registry.WithStrEndKey("/test_range/dd"), registry.WithCountOnly()) // [b, dd) !!!
 	if err != nil || !resp.Succeeded || resp.Count != 3 || resp.Kvs != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 	// get prefix paging
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/"), registry.WithPrefix(),
 		registry.WithOffset(2), registry.WithLimit(2))
 	if err != nil || !resp.Succeeded || resp.Count != 5 || len(resp.Kvs) != 2 ||
@@ -245,14 +253,14 @@ func TestEtcdClient(t *testing.T) {
 		string(resp.Kvs[1].Key) != "/test_range/d" || string(resp.Kvs[1].Value) != "d" {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/"), registry.WithPrefix(), registry.WithKeyOnly(),
 		registry.WithOffset(4), registry.WithLimit(2))
 	if err != nil || !resp.Succeeded || resp.Count != 5 || len(resp.Kvs) != 1 ||
 		string(resp.Kvs[0].Key) != "/test_range/dd" || resp.Kvs[0].Value != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/d"), registry.WithPrefix(), registry.WithKeyOnly(),
 		registry.WithOffset(0), registry.WithLimit(2))
 	if err != nil || !resp.Succeeded || resp.Count != 2 || len(resp.Kvs) != 2 ||
@@ -260,27 +268,27 @@ func TestEtcdClient(t *testing.T) {
 		string(resp.Kvs[1].Key) != "/test_range/dd" || resp.Kvs[1].Value != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/"), registry.WithPrefix(), registry.WithCountOnly(),
 		registry.WithOffset(2), registry.WithLimit(2))
 	if err != nil || !resp.Succeeded || resp.Count != 5 || resp.Kvs != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/"), registry.WithPrefix(),
 		registry.WithOffset(6), registry.WithLimit(2))
 	if err != nil || !resp.Succeeded || resp.Count != 5 || len(resp.Kvs) != 0 {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 	// if offset < -1, just paging by limit
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/"), registry.WithPrefix(),
 		registry.WithOffset(-2), registry.WithLimit(2))
 	if err != nil || !resp.Succeeded || resp.Count != 5 || len(resp.Kvs) != 5 {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 	// get range paging
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/b"),
 		registry.WithStrEndKey("/test_range/dd"),
 		registry.WithOffset(2), registry.WithLimit(2))
@@ -288,7 +296,7 @@ func TestEtcdClient(t *testing.T) {
 		string(resp.Kvs[0].Key) != "/test_range/d" {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/a"),
 		registry.WithStrEndKey("/test_range/dd"),
 		registry.WithOffset(2), registry.WithLimit(2))
@@ -297,7 +305,7 @@ func TestEtcdClient(t *testing.T) {
 		string(resp.Kvs[1].Key) != "/test_range/d" {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/a"),
 		registry.WithStrEndKey("/test_range/dd"), registry.WithKeyOnly(),
 		registry.WithOffset(2), registry.WithLimit(2))
@@ -306,21 +314,21 @@ func TestEtcdClient(t *testing.T) {
 		string(resp.Kvs[1].Key) != "/test_range/d" || resp.Kvs[1].Value != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/a"),
 		registry.WithStrEndKey("/test_range/dd"), registry.WithCountOnly(),
 		registry.WithOffset(2), registry.WithLimit(2))
 	if err != nil || !resp.Succeeded || resp.Count != 4 || resp.Kvs != nil {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/b"),
 		registry.WithStrEndKey("/test_range/dd"),
 		registry.WithOffset(5), registry.WithLimit(2))
 	if err != nil || !resp.Succeeded || resp.Count != 3 || len(resp.Kvs) != 0 {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_range/a"),
 		registry.WithStrEndKey("/test_range/dd"),
 		registry.WithOffset(4), registry.WithLimit(2))
@@ -328,24 +336,24 @@ func TestEtcdClient(t *testing.T) {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 	// delete range
-	resp, err = etcd.Do(context.Background(), registry.DEL,
+	resp, err = etcdc.Do(context.Background(), registry.DEL,
 		registry.WithStrKey("/test_range/b"),
 		registry.WithStrEndKey("/test_range/dd")) // [b, d) !!!
 	if err != nil || !resp.Succeeded {
 		t.Fatalf("TestEtcdClient_Delete failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/"),
+	resp, err = etcdc.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/"),
 		registry.WithPrefix())
 	if err != nil || !resp.Succeeded || len(resp.Kvs) != 2 || string(resp.Kvs[1].Key) != "/test_range/dd" {
 		t.Fatalf("TestEtcdClient_Delete failed, %#v", resp.Kvs)
 	}
 	// delete prefix
-	resp, err = etcd.Do(context.Background(), registry.DEL, registry.WithStrKey("/test_range/"),
+	resp, err = etcdc.Do(context.Background(), registry.DEL, registry.WithStrKey("/test_range/"),
 		registry.WithPrefix())
 	if err != nil || !resp.Succeeded {
 		t.Fatalf("TestEtcdClient_Delete failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/"),
+	resp, err = etcdc.Do(context.Background(), registry.GET, registry.WithStrKey("/test_range/"),
 		registry.WithPrefix())
 	if err != nil || !resp.Succeeded || resp.Count != 0 {
 		t.Fatalf("TestEtcdClient_Delete failed, %#v", err)
@@ -358,7 +366,7 @@ func TestEtcdClient(t *testing.T) {
 		v := strconv.Itoa(i)
 		go func() {
 			defer wg.Done()
-			resp, err = etcd.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_page/"+v),
+			resp, err = etcdc.Do(context.Background(), registry.PUT, registry.WithStrKey("/test_page/"+v),
 				registry.WithStrValue(v))
 			if err != nil || !resp.Succeeded {
 				t.Fatalf("TestEtcdClient_Do failed, %#v", err)
@@ -366,14 +374,14 @@ func TestEtcdClient(t *testing.T) {
 		}()
 	}
 	wg.Wait()
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_page/"),
 		registry.WithStrEndKey("/test_page/9999"))
 	if err != nil || !resp.Succeeded || resp.Count != registry.DEFAULT_PAGE_COUNT+1 ||
 		len(resp.Kvs) != registry.DEFAULT_PAGE_COUNT+1 {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_page/"), registry.WithPrefix(), registry.WithDescendOrder())
 	if err != nil || !resp.Succeeded || resp.Count != registry.DEFAULT_PAGE_COUNT+1 ||
 		len(resp.Kvs) != registry.DEFAULT_PAGE_COUNT+1 ||
@@ -381,13 +389,13 @@ func TestEtcdClient(t *testing.T) {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
 	}
 	// delete range
-	resp, err = etcd.Do(context.Background(), registry.DEL,
+	resp, err = etcdc.Do(context.Background(), registry.DEL,
 		registry.WithStrKey("/test_page/"),
 		registry.WithStrEndKey("/test_page/9999"))
 	if err != nil || !resp.Succeeded {
 		t.Fatalf("TestEtcdClient_Delete failed, %#v", err)
 	}
-	resp, err = etcd.Do(context.Background(), registry.GET,
+	resp, err = etcdc.Do(context.Background(), registry.GET,
 		registry.WithStrKey("/test_page/"), registry.WithPrefix())
 	if err != nil || !resp.Succeeded || resp.Count != 0 {
 		t.Fatalf("TestEtcdClient_Do failed, %#v", err)
@@ -535,59 +543,47 @@ func TestEtcdClient_LeaseRenew(t *testing.T) {
 }
 
 func TestEtcdClient_HealthCheck(t *testing.T) {
-	etcd := &EtcdClient{
+	etcdc := &EtcdClient{
 		Endpoints:        []string{endpoint},
 		DialTimeout:      dialTimeout,
 		AutoSyncInterval: time.Millisecond,
 	}
-	err := etcd.Initialize()
-	if err != nil {
-		t.Fatalf("TestEtcdClient failed, %#v", err)
-	}
-	defer etcd.Close()
+	err := etcdc.Initialize()
+	assert.NoError(t, err)
+	defer etcdc.Close()
 
-	err = etcd.ReOpen()
-	if err != nil {
-		t.Fatalf("TestEtcdClient failed, %#v", err)
-	}
+	err = etcdc.ReOpen()
+	assert.NoError(t, err)
 	ctx, _ := context.WithTimeout(context.Background(), dialTimeout)
-	err = etcd.SyncMembers(ctx)
-	if err != nil {
-		t.Fatalf("TestEtcdClient failed, %#v", err)
-	}
-	etcd.Endpoints = []string{"x"}
-	err = etcd.ReOpen()
-	if err == nil {
-		t.Fatalf("TestEtcdClient failed, %#v", err)
-	}
-	ctx, _ = context.WithTimeout(context.Background(), dialTimeout)
-	err = etcd.SyncMembers(ctx)
-	if err != nil {
-		t.Fatalf("TestEtcdClient failed, %#v", err)
-	}
-	etcd.Endpoints = []string{endpoint}
+	err = etcdc.SyncMembers(ctx)
+	assert.NoError(t, err)
+	etcdc.Endpoints = []string{"x"}
+	err = etcdc.ReOpen()
+	assert.Error(t, err)
+
+	t.Run("before check", func(t *testing.T) {
+		ctx, _ = context.WithTimeout(context.Background(), dialTimeout)
+		err = etcdc.SyncMembers(ctx)
+		assert.NoError(t, err)
+	})
 
-	etcd.Close()
-	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
-	go func() {
-		for {
-			select {
-			case <-time.After(time.Second):
-				_, err = etcd.Do(context.Background(), registry.GET,
-					registry.WithStrKey("/test_health/"))
-				if err != nil {
-					continue
-				}
-			case <-ctx.Done():
-			}
-			break
-		}
+	etcdc.Endpoints = []string{endpoint}
+
+	etcdc.Close()
+	ctx, _ = context.WithTimeout(context.Background(), 1*time.Second)
+	go etcdc.healthCheckLoop(ctx)
+	for {
+		_, err = etcdc.Do(context.Background(), registry.GET,
+			registry.WithStrKey("/test_health/"))
 		if err != nil {
-			t.Fatalf("TestEtcdClient failed, %#v", err)
+			time.Sleep(1 * time.Second)
+			continue
+		} else {
+			break
 		}
-		cancel()
-	}()
-	etcd.healthCheckLoop(ctx)
+	}
+	assert.NoError(t, err)
+
 }
 
 func TestEtcdClient_Watch(t *testing.T) {
diff --git a/server/plugin/pkg/registry/etcd/tracing.go b/server/plugin/pkg/registry/etcd/tracing.go
index b8dcc81..db4408d 100644
--- a/server/plugin/pkg/registry/etcd/tracing.go
+++ b/server/plugin/pkg/registry/etcd/tracing.go
@@ -17,10 +17,10 @@
 package etcd
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/tracing"
-	"golang.org/x/net/context"
 	"net/http"
 )
 
diff --git a/server/plugin/pkg/registry/registry.go b/server/plugin/pkg/registry/registry.go
index f2333b4..de14ed5 100644
--- a/server/plugin/pkg/registry/registry.go
+++ b/server/plugin/pkg/registry/registry.go
@@ -17,7 +17,7 @@
 package registry
 
 import (
-	"golang.org/x/net/context"
+	"context"
 )
 
 type Registry interface {
diff --git a/server/plugin/pkg/tls/buildin/tls_test.go b/server/plugin/pkg/tls/buildin/tls_test.go
index e23d3f4..3a737b8 100644
--- a/server/plugin/pkg/tls/buildin/tls_test.go
+++ b/server/plugin/pkg/tls/buildin/tls_test.go
@@ -14,25 +14,27 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package buildin
+package buildin_test
 
 import (
 	"crypto/tls"
 	"github.com/apache/servicecomb-service-center/server/core"
 	_ "github.com/apache/servicecomb-service-center/server/plugin/pkg/security/buildin"
+	"github.com/apache/servicecomb-service-center/server/plugin/pkg/tls/buildin"
+	"github.com/stretchr/testify/assert"
 	"os"
 	"testing"
 )
 
 func init() {
+	testing.Init()
 	core.Initialize()
-
 	sslRoot := "../../../../../examples/service_center/ssl/"
 	os.Setenv("SSL_ROOT", sslRoot)
 }
 
 func TestGetServerTLSConfig(t *testing.T) {
-	serverTLSConfig, err := GetServerTLSConfig()
+	serverTLSConfig, err := buildin.GetServerTLSConfig()
 	if err != nil {
 		t.Fatalf("GetServerTLSConfig failed")
 	}
@@ -48,16 +50,12 @@ func TestGetServerTLSConfig(t *testing.T) {
 	if serverTLSConfig.MinVersion != tls.VersionTLS12 {
 		t.Fatalf("GetServerTLSConfig failed")
 	}
-	if serverTLSConfig.MaxVersion != tls.VersionTLS12 {
-		t.Fatalf("GetServerTLSConfig failed")
-	}
-	if serverTLSConfig.ClientAuth != tls.RequireAndVerifyClientCert {
-		t.Fatalf("GetServerTLSConfig failed")
-	}
+	assert.Equal(t, int(serverTLSConfig.MaxVersion), int(tls.VersionTLS13))
+	assert.Equal(t, serverTLSConfig.ClientAuth, tls.RequireAndVerifyClientCert)
 }
 
 func TestGetClientTLSConfig(t *testing.T) {
-	clientTLSConfig, err := GetClientTLSConfig()
+	clientTLSConfig, err := buildin.GetClientTLSConfig()
 	if err != nil {
 		t.Fatalf("GetClientTLSConfig failed")
 	}
@@ -73,9 +71,7 @@ func TestGetClientTLSConfig(t *testing.T) {
 	if clientTLSConfig.MinVersion != tls.VersionTLS12 {
 		t.Fatalf("GetClientTLSConfig failed")
 	}
-	if clientTLSConfig.MaxVersion != tls.VersionTLS12 {
-		t.Fatalf("GetClientTLSConfig failed")
-	}
+	assert.Equal(t, int(clientTLSConfig.MaxVersion), tls.VersionTLS13)
 	if clientTLSConfig.InsecureSkipVerify != true {
 		t.Fatalf("GetClientTLSConfig failed")
 	}
diff --git a/server/plugin/pkg/tracing/buildin/file_collector.go b/server/plugin/pkg/tracing/buildin/file_collector.go
index 5db91e0..f3deec0 100644
--- a/server/plugin/pkg/tracing/buildin/file_collector.go
+++ b/server/plugin/pkg/tracing/buildin/file_collector.go
@@ -18,6 +18,7 @@ package buildin
 
 import (
 	"bufio"
+	"context"
 	"encoding/json"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
@@ -25,7 +26,6 @@ import (
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
-	"golang.org/x/net/context"
 	"os"
 	"strings"
 	"time"
diff --git a/server/plugin/pkg/tracing/buildin/file_collector_test.go b/server/plugin/pkg/tracing/buildin/file_collector_test.go
index fbf5609..2fc833e 100644
--- a/server/plugin/pkg/tracing/buildin/file_collector_test.go
+++ b/server/plugin/pkg/tracing/buildin/file_collector_test.go
@@ -17,10 +17,10 @@
 package buildin
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
-	"golang.org/x/net/context"
 	"os"
 	"testing"
 	"time"
diff --git a/server/plugin/pkg/tracing/tracing.go b/server/plugin/pkg/tracing/tracing.go
index 4d98c2e..f9fdbc1 100644
--- a/server/plugin/pkg/tracing/tracing.go
+++ b/server/plugin/pkg/tracing/tracing.go
@@ -17,8 +17,8 @@
 package tracing
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 const CTX_TRACE_SPAN = "x-trace-span"
diff --git a/server/plugin/pkg/uuid/buildin/buildin.go b/server/plugin/pkg/uuid/buildin/buildin.go
index 68640ae..4b27bd5 100644
--- a/server/plugin/pkg/uuid/buildin/buildin.go
+++ b/server/plugin/pkg/uuid/buildin/buildin.go
@@ -18,9 +18,9 @@
 package buildin
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
-	"golang.org/x/net/context"
 )
 
 func init() {
diff --git a/server/plugin/pkg/uuid/context/context.go b/server/plugin/pkg/uuid/context/context.go
index 0c9702d..3a76893 100644
--- a/server/plugin/pkg/uuid/context/context.go
+++ b/server/plugin/pkg/uuid/context/context.go
@@ -18,13 +18,13 @@
 package context
 
 import (
+	"context"
 	"crypto/sha1"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	mgr "github.com/apache/servicecomb-service-center/server/plugin"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/uuid"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/uuid/buildin"
-	"golang.org/x/net/context"
 )
 
 func init() {
diff --git a/server/plugin/pkg/uuid/uuid.go b/server/plugin/pkg/uuid/uuid.go
index 08bab8e..c0dd161 100644
--- a/server/plugin/pkg/uuid/uuid.go
+++ b/server/plugin/pkg/uuid/uuid.go
@@ -16,7 +16,7 @@
  */
 package uuid
 
-import "golang.org/x/net/context"
+import "context"
 
 const ContextKey = "_uuid_key"
 
diff --git a/server/server.go b/server/server.go
index 8f04b66..d4aa24c 100644
--- a/server/server.go
+++ b/server/server.go
@@ -22,6 +22,7 @@ import (
 	"os"
 	"time"
 
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	nf "github.com/apache/servicecomb-service-center/pkg/notify"
@@ -34,7 +35,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/task"
 	"github.com/apache/servicecomb-service-center/version"
 	"github.com/astaxie/beego"
-	"golang.org/x/net/context"
 )
 
 const buildin = "buildin"
@@ -83,6 +83,7 @@ func (s *ServiceCenterServer) needUpgrade() bool {
 
 func (s *ServiceCenterServer) loadOrUpgradeServerVersion() {
 	lock, err := mux.Lock(mux.GlobalLock)
+
 	if err != nil {
 		log.Errorf(err, "wait for server ready failed")
 		os.Exit(1)
diff --git a/server/service/cache/dependency.go b/server/service/cache/dependency.go
index b4f77fe..ec35f47 100644
--- a/server/service/cache/dependency.go
+++ b/server/service/cache/dependency.go
@@ -17,10 +17,10 @@
 package cache
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/cache"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"math"
 )
 
diff --git a/server/service/cache/filter_consistency.go b/server/service/cache/filter_consistency.go
index feb18bc..eba5af0 100644
--- a/server/service/cache/filter_consistency.go
+++ b/server/service/cache/filter_consistency.go
@@ -23,7 +23,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 // ConsistencyFilter improves consistency.
diff --git a/server/service/cache/filter_consumer.go b/server/service/cache/filter_consumer.go
index 3691cb5..77b8800 100644
--- a/server/service/cache/filter_consumer.go
+++ b/server/service/cache/filter_consumer.go
@@ -17,8 +17,8 @@
 package cache
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/cache"
-	"golang.org/x/net/context"
 )
 
 type ConsumerFilter struct {
diff --git a/server/service/cache/filter_instances.go b/server/service/cache/filter_instances.go
index 4c0b58b..38f9f9b 100644
--- a/server/service/cache/filter_instances.go
+++ b/server/service/cache/filter_instances.go
@@ -17,6 +17,7 @@
 package cache
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/cache"
 	"github.com/apache/servicecomb-service-center/pkg/log"
@@ -25,7 +26,6 @@ import (
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"sort"
 )
 
diff --git a/server/service/cache/filter_permission.go b/server/service/cache/filter_permission.go
index f2726b1..bd23010 100644
--- a/server/service/cache/filter_permission.go
+++ b/server/service/cache/filter_permission.go
@@ -17,12 +17,12 @@
 package cache
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/cache"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 type AccessibleFilter struct {
diff --git a/server/service/cache/filter_service.go b/server/service/cache/filter_service.go
index 08fbc4e..02fc400 100644
--- a/server/service/cache/filter_service.go
+++ b/server/service/cache/filter_service.go
@@ -17,10 +17,10 @@
 package cache
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/cache"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
-	"golang.org/x/net/context"
 )
 
 type ServiceFilter struct {
diff --git a/server/service/cache/filter_tags.go b/server/service/cache/filter_tags.go
index 41b1981..3af5067 100644
--- a/server/service/cache/filter_tags.go
+++ b/server/service/cache/filter_tags.go
@@ -17,13 +17,13 @@
 package cache
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/cache"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"sort"
 	"strings"
 )
diff --git a/server/service/cache/filter_version.go b/server/service/cache/filter_version.go
index 099d261..763ba95 100644
--- a/server/service/cache/filter_version.go
+++ b/server/service/cache/filter_version.go
@@ -17,12 +17,12 @@
 package cache
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/cache"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 type VersionRuleFilter struct {
diff --git a/server/service/cache/instance.go b/server/service/cache/instance.go
index 72b2593..4f3ae54 100644
--- a/server/service/cache/instance.go
+++ b/server/service/cache/instance.go
@@ -17,10 +17,10 @@
 package cache
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/cache"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"math"
 	"time"
 )
diff --git a/server/service/dependency.go b/server/service/dependency.go
index 00b13d7..50100e5 100644
--- a/server/service/dependency.go
+++ b/server/service/dependency.go
@@ -17,6 +17,7 @@
 package service
 
 import (
+	"context"
 	"encoding/json"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
@@ -27,7 +28,6 @@ import (
 	scerr "github.com/apache/servicecomb-service-center/server/error"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 func (s *MicroServiceService) AddDependenciesForMicroServices(ctx context.Context, in *pb.AddDependenciesRequest) (*pb.AddDependenciesResponse, error) {
diff --git a/server/service/event/dependency_event_handler.go b/server/service/event/dependency_event_handler.go
index 8f01174..c4e148e 100644
--- a/server/service/event/dependency_event_handler.go
+++ b/server/service/event/dependency_event_handler.go
@@ -17,6 +17,7 @@
 package event
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/backoff"
 	"github.com/apache/servicecomb-service-center/pkg/gopool"
@@ -30,7 +31,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"time"
 )
 
diff --git a/server/service/event/dependency_rule_event_handler_test.go b/server/service/event/dependency_rule_event_handler_test.go
index 8e9423e..c959e77 100644
--- a/server/service/event/dependency_rule_event_handler_test.go
+++ b/server/service/event/dependency_rule_event_handler_test.go
@@ -17,11 +17,11 @@
 package event
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/server/core"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/service/cache"
-	"golang.org/x/net/context"
 	"testing"
 )
 
diff --git a/server/service/event/instance_event_handler.go b/server/service/event/instance_event_handler.go
index e74b16e..a4c8fc5 100644
--- a/server/service/event/instance_event_handler.go
+++ b/server/service/event/instance_event_handler.go
@@ -17,6 +17,7 @@
 package event
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	apt "github.com/apache/servicecomb-service-center/server/core"
@@ -27,7 +28,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/service/cache"
 	"github.com/apache/servicecomb-service-center/server/service/metrics"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"strings"
 )
 
diff --git a/server/service/event/rule_event_handler.go b/server/service/event/rule_event_handler.go
index 86d02fc..a2e239c 100644
--- a/server/service/event/rule_event_handler.go
+++ b/server/service/event/rule_event_handler.go
@@ -17,6 +17,7 @@
 package event
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/task"
@@ -26,7 +27,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/notify"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 type RulesChangedTask struct {
diff --git a/server/service/event/service_event_handler.go b/server/service/event/service_event_handler.go
index 35bc32d..aa0a943 100644
--- a/server/service/event/service_event_handler.go
+++ b/server/service/event/service_event_handler.go
@@ -17,6 +17,7 @@
 package event
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/apache/servicecomb-service-center/server/core/backend"
@@ -25,7 +26,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/service/cache"
 	"github.com/apache/servicecomb-service-center/server/service/metrics"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"strings"
 )
 
diff --git a/server/service/event/tag_event_handler.go b/server/service/event/tag_event_handler.go
index 3ac94e6..b6a0e44 100644
--- a/server/service/event/tag_event_handler.go
+++ b/server/service/event/tag_event_handler.go
@@ -17,6 +17,7 @@
 package event
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/task"
@@ -27,7 +28,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/service/cache"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 type TagsChangedTask struct {
diff --git a/server/service/instance.go b/server/service/instance.go
index fbd556d..beb14f3 100644
--- a/server/service/instance.go
+++ b/server/service/instance.go
@@ -17,6 +17,7 @@
 package service
 
 import (
+	"context"
 	"encoding/json"
 	"errors"
 	"fmt"
@@ -34,7 +35,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	"github.com/apache/servicecomb-service-center/server/service/cache"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"math"
 	"os"
 	"strconv"
diff --git a/server/service/microservice.go b/server/service/microservice.go
index a581087..45121dc 100644
--- a/server/service/microservice.go
+++ b/server/service/microservice.go
@@ -37,7 +37,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/uuid"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 type MicroServiceService struct {
diff --git a/server/service/rule.go b/server/service/rule.go
index 7babfac..9beb7da 100644
--- a/server/service/rule.go
+++ b/server/service/rule.go
@@ -17,6 +17,7 @@
 package service
 
 import (
+	"context"
 	"encoding/json"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
@@ -28,7 +29,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/quota"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 	"strconv"
 	"time"
 )
diff --git a/server/service/schema.go b/server/service/schema.go
index 6050a0b..18e035a 100644
--- a/server/service/schema.go
+++ b/server/service/schema.go
@@ -32,7 +32,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 func (s *MicroServiceService) GetSchemaInfo(ctx context.Context, in *pb.GetSchemaRequest) (*pb.GetSchemaResponse, error) {
diff --git a/server/service/service_suite_test.go b/server/service/service_suite_test.go
index add8e1c..b220790 100644
--- a/server/service/service_suite_test.go
+++ b/server/service/service_suite_test.go
@@ -17,9 +17,9 @@
 package service_test
 
 // initialize
-import _ "github.com/apache/servicecomb-service-center/server/init"
 import _ "github.com/apache/servicecomb-service-center/server/bootstrap"
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/core"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
@@ -29,7 +29,6 @@ import (
 	. "github.com/onsi/ginkgo"
 	"github.com/onsi/ginkgo/reporters"
 	. "github.com/onsi/gomega"
-	"golang.org/x/net/context"
 	"testing"
 )
 
@@ -38,6 +37,8 @@ var instanceResource pb.ServiceInstanceCtrlServerEx
 
 func init() {
 	beego.AppConfig.Set("registry_plugin", "etcd")
+	testing.Init()
+	core.Initialize()
 }
 
 var _ = BeforeSuite(func() {
diff --git a/server/service/tag.go b/server/service/tag.go
index 028049f..48824cd 100644
--- a/server/service/tag.go
+++ b/server/service/tag.go
@@ -17,6 +17,7 @@
 package service
 
 import (
+	"context"
 	"encoding/json"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
@@ -28,7 +29,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/quota"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
-	"golang.org/x/net/context"
 )
 
 func (s *MicroServiceService) AddTags(ctx context.Context, in *pb.AddServiceTagsRequest) (*pb.AddServiceTagsResponse, error) {
diff --git a/server/service/util/dependency.go b/server/service/util/dependency.go
index e9aedbb..27b3dfe 100644
--- a/server/service/util/dependency.go
+++ b/server/service/util/dependency.go
@@ -17,13 +17,13 @@
 package util
 
 import (
+	"context"
 	"encoding/json"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	apt "github.com/apache/servicecomb-service-center/server/core"
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 type Dependency struct {
diff --git a/server/service/util/dependency_query.go b/server/service/util/dependency_query.go
index 0e215d9..7003a54 100644
--- a/server/service/util/dependency_query.go
+++ b/server/service/util/dependency_query.go
@@ -17,6 +17,7 @@
 package util
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
@@ -24,7 +25,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"strings"
 )
 
diff --git a/server/service/util/dependency_test.go b/server/service/util/dependency_test.go
index e10397f..03b2770 100644
--- a/server/service/util/dependency_test.go
+++ b/server/service/util/dependency_test.go
@@ -17,8 +17,8 @@
 package util
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
-	"golang.org/x/net/context"
 	"testing"
 )
 
diff --git a/server/service/util/dependency_util.go b/server/service/util/dependency_util.go
index b01212e..92ba3b8 100644
--- a/server/service/util/dependency_util.go
+++ b/server/service/util/dependency_util.go
@@ -17,6 +17,7 @@
 package util
 
 import (
+	"context"
 	"encoding/json"
 	"errors"
 	"fmt"
@@ -27,7 +28,6 @@ import (
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	scerr "github.com/apache/servicecomb-service-center/server/error"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"strings"
 )
 
diff --git a/server/service/util/domain_util.go b/server/service/util/domain_util.go
index 3e49ca6..55100f9 100644
--- a/server/service/util/domain_util.go
+++ b/server/service/util/domain_util.go
@@ -17,13 +17,13 @@
 package util
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	apt "github.com/apache/servicecomb-service-center/server/core"
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"strings"
 )
 
diff --git a/server/service/util/domain_util_test.go b/server/service/util/domain_util_test.go
index ff182e0..667cbc3 100644
--- a/server/service/util/domain_util_test.go
+++ b/server/service/util/domain_util_test.go
@@ -17,7 +17,7 @@
 package util
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"testing"
 )
 
diff --git a/server/service/util/heartbeat_util.go b/server/service/util/heartbeat_util.go
index 6b12ea6..89a0845 100644
--- a/server/service/util/heartbeat_util.go
+++ b/server/service/util/heartbeat_util.go
@@ -17,12 +17,12 @@
 package util
 
 import (
+	"context"
 	"errors"
 	apt "github.com/apache/servicecomb-service-center/server/core"
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	scerr "github.com/apache/servicecomb-service-center/server/error"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 func HeartbeatUtil(ctx context.Context, domainProject string, serviceId string, instanceId string) (leaseID int64, ttl int64, _ *scerr.Error) {
diff --git a/server/service/util/heartbeat_util_test.go b/server/service/util/heartbeat_util_test.go
index 557f5ed..f648dca 100644
--- a/server/service/util/heartbeat_util_test.go
+++ b/server/service/util/heartbeat_util_test.go
@@ -17,7 +17,7 @@
 package util
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"testing"
 )
 
diff --git a/server/service/util/instance_util.go b/server/service/util/instance_util.go
index 51cd5fe..7953744 100644
--- a/server/service/util/instance_util.go
+++ b/server/service/util/instance_util.go
@@ -17,6 +17,7 @@
 package util
 
 import (
+	"context"
 	"crypto/sha1"
 	"encoding/json"
 	"fmt"
@@ -28,7 +29,6 @@ import (
 	scerr "github.com/apache/servicecomb-service-center/server/error"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/discovery"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"strconv"
 	"strings"
 	"time"
diff --git a/server/service/util/instance_util_test.go b/server/service/util/instance_util_test.go
index 4ba0ffc..656678e 100644
--- a/server/service/util/instance_util_test.go
+++ b/server/service/util/instance_util_test.go
@@ -17,10 +17,10 @@
 package util
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	scerr "github.com/apache/servicecomb-service-center/server/error"
-	"golang.org/x/net/context"
 	"testing"
 )
 
diff --git a/server/service/util/microservice_util.go b/server/service/util/microservice_util.go
index 4880ee3..772ee67 100644
--- a/server/service/util/microservice_util.go
+++ b/server/service/util/microservice_util.go
@@ -30,7 +30,7 @@ import (
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/quota"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
 
-	"golang.org/x/net/context"
+	"context"
 )
 
 /*
diff --git a/server/service/util/rule_util.go b/server/service/util/rule_util.go
index 4c0fe2b..eab952b 100644
--- a/server/service/util/rule_util.go
+++ b/server/service/util/rule_util.go
@@ -17,6 +17,7 @@
 package util
 
 import (
+	"context"
 	"fmt"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
@@ -25,7 +26,6 @@ import (
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	scerr "github.com/apache/servicecomb-service-center/server/error"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 	"reflect"
 	"regexp"
 	"strings"
diff --git a/server/service/util/rule_util_test.go b/server/service/util/rule_util_test.go
index edaea1f..9e47447 100644
--- a/server/service/util/rule_util_test.go
+++ b/server/service/util/rule_util_test.go
@@ -17,9 +17,9 @@
 package util
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
-	"golang.org/x/net/context"
 	"net/http"
 	"testing"
 )
diff --git a/server/service/util/schema_util.go b/server/service/util/schema_util.go
index d255e88..0c86127 100644
--- a/server/service/util/schema_util.go
+++ b/server/service/util/schema_util.go
@@ -17,9 +17,9 @@
 package util
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 func CheckSchemaInfoExist(ctx context.Context, key string) (bool, error) {
diff --git a/server/service/util/schema_util_test.go b/server/service/util/schema_util_test.go
index 251d0ca..fd7a019 100644
--- a/server/service/util/schema_util_test.go
+++ b/server/service/util/schema_util_test.go
@@ -17,7 +17,7 @@
 package util
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"testing"
 )
 
diff --git a/server/service/util/tag_util.go b/server/service/util/tag_util.go
index e179566..215c8ae 100644
--- a/server/service/util/tag_util.go
+++ b/server/service/util/tag_util.go
@@ -17,6 +17,7 @@
 package util
 
 import (
+	"context"
 	"encoding/json"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
@@ -24,7 +25,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	scerr "github.com/apache/servicecomb-service-center/server/error"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 func AddTagIntoETCD(ctx context.Context, domainProject string, serviceId string, dataTags map[string]string) *scerr.Error {
diff --git a/server/service/util/tag_util_test.go b/server/service/util/tag_util_test.go
index 61b6131..65796ec 100644
--- a/server/service/util/tag_util_test.go
+++ b/server/service/util/tag_util_test.go
@@ -17,7 +17,7 @@
 package util
 
 import (
-	"golang.org/x/net/context"
+	"context"
 	"testing"
 )
 
diff --git a/server/service/util/util.go b/server/service/util/util.go
index 677a559..afeddfe 100644
--- a/server/service/util/util.go
+++ b/server/service/util/util.go
@@ -17,8 +17,8 @@
 package util
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 func FromContext(ctx context.Context) []registry.PluginOpOption {
diff --git a/server/service/util/util_suite_test.go b/server/service/util/util_suite_test.go
index 8d1b783..e7f4b4b 100644
--- a/server/service/util/util_suite_test.go
+++ b/server/service/util/util_suite_test.go
@@ -23,6 +23,7 @@ import (
 )
 
 import (
+	"context"
 	"github.com/apache/servicecomb-service-center/pkg/util"
 	"github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
@@ -30,7 +31,6 @@ import (
 	. "github.com/onsi/ginkgo"
 	"github.com/onsi/ginkgo/reporters"
 	. "github.com/onsi/gomega"
-	"golang.org/x/net/context"
 	"testing"
 )
 
diff --git a/server/service/watch.go b/server/service/watch.go
index 8b4c039..250106b 100644
--- a/server/service/watch.go
+++ b/server/service/watch.go
@@ -17,6 +17,7 @@
 package service
 
 import (
+	"context"
 	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/pkg/util"
@@ -24,7 +25,6 @@ import (
 	"github.com/apache/servicecomb-service-center/server/notify"
 	serviceUtil "github.com/apache/servicecomb-service-center/server/service/util"
 	"github.com/gorilla/websocket"
-	"golang.org/x/net/context"
 )
 
 func (s *InstanceService) WatchPreOpera(ctx context.Context, in *pb.WatchInstanceRequest) error {
diff --git a/server/service/watch_test.go b/server/service/watch_test.go
index 68f4cf2..b0902b1 100644
--- a/server/service/watch_test.go
+++ b/server/service/watch_test.go
@@ -17,11 +17,11 @@
 package service_test
 
 import (
+	"context"
 	pb "github.com/apache/servicecomb-service-center/server/core/proto"
 	"github.com/apache/servicecomb-service-center/server/service"
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
-	"golang.org/x/net/context"
 	"google.golang.org/grpc"
 	"testing"
 )
diff --git a/server/task/clear_service_test.go b/server/task/clear_service_test.go
index 0d61934..0408e69 100644
--- a/server/task/clear_service_test.go
+++ b/server/task/clear_service_test.go
@@ -16,7 +16,6 @@
 package task_test
 
 // initialize
-import _ "github.com/apache/servicecomb-service-center/server/init"
 import _ "github.com/apache/servicecomb-service-center/server/bootstrap"
 import _ "github.com/apache/servicecomb-service-center/server"
 
@@ -37,6 +36,11 @@ import (
 	. "github.com/onsi/gomega"
 )
 
+func init() {
+	testing.Init()
+	apt.Initialize()
+}
+
 var _ = BeforeSuite(func() {
 	beego.AppConfig.Set("registry_plugin", "etcd")
 	//clear service created in last test
@@ -146,3 +150,7 @@ var _ = Describe("clear service", func() {
 	Describe("domain project 1", serviceClearCheckFunc("default1", "default"))
 	Describe("domain project 2", serviceClearCheckFunc("default2", "default"))
 })
+var _ = func() bool {
+
+	return true
+}()
diff --git a/server/version.go b/server/version.go
index a3ee182..eb6aea8 100644
--- a/server/version.go
+++ b/server/version.go
@@ -17,12 +17,12 @@
 package server
 
 import (
+	"context"
 	"encoding/json"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/server/core"
 	"github.com/apache/servicecomb-service-center/server/core/backend"
 	"github.com/apache/servicecomb-service-center/server/plugin/pkg/registry"
-	"golang.org/x/net/context"
 )
 
 func LoadServerVersion() error {
diff --git a/syncer/config/config.go b/syncer/config/config.go
index c334320..e71c598 100644
--- a/syncer/config/config.go
+++ b/syncer/config/config.go
@@ -22,9 +22,9 @@ import (
 	"path/filepath"
 	"strconv"
 
+	"errors"
 	"github.com/apache/servicecomb-service-center/pkg/log"
 	"github.com/apache/servicecomb-service-center/syncer/pkg/utils"
-	"github.com/pkg/errors"
 	"gopkg.in/yaml.v2"
 	"k8s.io/apimachinery/pkg/util/uuid"
 )
diff --git a/syncer/config/config_test.go b/syncer/config/config_test.go
index 317460d..873238c 100644
--- a/syncer/config/config_test.go
+++ b/syncer/config/config_test.go
@@ -148,7 +148,7 @@ func TestVerify(t *testing.T) {
 
 	params := conf.Task.Params
 	conf.Task.Kind = ""
-	conf.Task.Params = []Label{{Key: "test", Value:"test"}, {Key:defaultTaskKey, Value: "3mams"}}
+	conf.Task.Params = []Label{{Key: "test", Value: "test"}, {Key: defaultTaskKey, Value: "3mams"}}
 	err = Verify(conf)
 	conf.Task.Params = params
 	assert.NotNil(t, err)
@@ -227,4 +227,4 @@ tlsConfigs:
     certFile: ./certs/server.cer
     keyFile: ./certs/server_key.pem
 `)
-}
\ No newline at end of file
+}
diff --git a/syncer/grpc/grpc_test.go b/syncer/grpc/grpc_test.go
index 8240a82..9fa94c8 100644
--- a/syncer/grpc/grpc_test.go
+++ b/syncer/grpc/grpc_test.go
@@ -29,9 +29,9 @@ import (
 	ggrpc "google.golang.org/grpc"
 )
 
-type testServer struct {}
+type testServer struct{}
 
-func (t *testServer) Pull(context.Context, *pb.PullRequest) (*pb.SyncData, error){
+func (t *testServer) Pull(context.Context, *pb.PullRequest) (*pb.SyncData, error) {
 	return &pb.SyncData{}, nil
 }
 
diff --git a/syncer/pkg/mock/mockplugin/instance.go b/syncer/pkg/mock/mockplugin/instance.go
index 53711d7..337cebc 100644
--- a/syncer/pkg/mock/mockplugin/instance.go
+++ b/syncer/pkg/mock/mockplugin/instance.go
@@ -27,10 +27,9 @@ var (
 	registerInstance   func(ctx context.Context, domainProject, serviceId string, instance *pb.SyncInstance) (string, error)
 	unregisterInstance func(ctx context.Context, domainProject, serviceId, instanceId string) error
 	heartbeat          func(ctx context.Context, domainProject, serviceId, instanceId string) error
-
 )
 
-func SetRegisterInstance(handler  func(ctx context.Context, domainProject, serviceId string, instance *pb.SyncInstance) (string, error)) {
+func SetRegisterInstance(handler func(ctx context.Context, domainProject, serviceId string, instance *pb.SyncInstance) (string, error)) {
 	registerInstance = handler
 }
 
diff --git a/syncer/pkg/mock/mockplugin/servicecenter.go b/syncer/pkg/mock/mockplugin/servicecenter.go
index 91259e6..76fe6ba 100644
--- a/syncer/pkg/mock/mockplugin/servicecenter.go
+++ b/syncer/pkg/mock/mockplugin/servicecenter.go
@@ -59,21 +59,21 @@ func NewGetAll(ctx context.Context) (*pb.SyncData, error) {
 	return &pb.SyncData{
 		Services: []*pb.SyncService{
 			{
-				ServiceId: "5db1b794aa6f8a875d6e68110260b5491ee7e223",
-				App:       "default",
-				Name:      "SERVICECENTER",
-				Version:   "1.1.0",
-				Status:    pb.SyncService_UP,
+				ServiceId:     "5db1b794aa6f8a875d6e68110260b5491ee7e223",
+				App:           "default",
+				Name:          "SERVICECENTER",
+				Version:       "1.1.0",
+				Status:        pb.SyncService_UP,
 				DomainProject: "default/default",
-				PluginName: PluginName,
+				PluginName:    PluginName,
 			}, {
-				ServiceId: "5db1b794aa6f8a875d6e68110260b5491ee7e211",
-				App:       "default",
-				Name:      "SERVICECENTER",
-				Version:   "1.1.0",
-				Status:    pb.SyncService_UP,
+				ServiceId:     "5db1b794aa6f8a875d6e68110260b5491ee7e211",
+				App:           "default",
+				Name:          "SERVICECENTER",
+				Version:       "1.1.0",
+				Status:        pb.SyncService_UP,
 				DomainProject: "default/default",
-				PluginName: PluginName,
+				PluginName:    PluginName,
 			},
 		},
 		Instances: []*pb.SyncInstance{
@@ -90,7 +90,7 @@ func NewGetAll(ctx context.Context) (*pb.SyncData, error) {
 					Interval: 30,
 					Times:    3,
 				},
-				Version: "1.1.0",
+				Version:    "1.1.0",
 				PluginName: PluginName,
 			}, {
 				InstanceId: "4d41a637471f11e9888cfa163eca30e0",
@@ -105,7 +105,7 @@ func NewGetAll(ctx context.Context) (*pb.SyncData, error) {
 					Interval: 30,
 					Times:    3,
 				},
-				Version: "1.1.0",
+				Version:    "1.1.0",
 				PluginName: PluginName,
 			}, {
 				InstanceId: "4d41a637471f11e9888cfa163eca30ab",
@@ -120,7 +120,7 @@ func NewGetAll(ctx context.Context) (*pb.SyncData, error) {
 					Interval: 30,
 					Times:    3,
 				},
-				Version: "1.1.0",
+				Version:    "1.1.0",
 				PluginName: PluginName,
 			},
 		},
@@ -134,13 +134,13 @@ func (c *mockPlugin) GetAll(ctx context.Context) (*pb.SyncData, error) {
 	return &pb.SyncData{
 		Services: []*pb.SyncService{
 			{
-				ServiceId: "5db1b794aa6f8a875d6e68110260b5491ee7e223",
-				App:       "default",
-				Name:      "SERVICECENTER",
-				Version:   "1.1.0",
-				Status:    pb.SyncService_UP,
+				ServiceId:     "5db1b794aa6f8a875d6e68110260b5491ee7e223",
+				App:           "default",
+				Name:          "SERVICECENTER",
+				Version:       "1.1.0",
+				Status:        pb.SyncService_UP,
 				DomainProject: "default/default",
-				PluginName: PluginName,
+				PluginName:    PluginName,
 			},
 		},
 		Instances: []*pb.SyncInstance{
@@ -157,7 +157,7 @@ func (c *mockPlugin) GetAll(ctx context.Context) (*pb.SyncData, error) {
 					Interval: 30,
 					Times:    3,
 				},
-				Version: "1.1.0",
+				Version:    "1.1.0",
 				PluginName: PluginName,
 			},
 		},
diff --git a/syncer/proto/syncer.pb.go b/syncer/proto/syncer.pb.go
index 2a1eb22..e21c6d2 100644
--- a/syncer/proto/syncer.pb.go
+++ b/syncer/proto/syncer.pb.go
@@ -23,7 +23,7 @@ import fmt "fmt"
 import math "math"
 
 import (
-	context "golang.org/x/net/context"
+	context "context"
 	grpc "google.golang.org/grpc"
 )
 
diff --git a/syncer/samples/multi-servicecenters/servicecenter/hello-server/main.go b/syncer/samples/multi-servicecenters/servicecenter/hello-server/main.go
index 5031d4c..a4ec93c 100644
--- a/syncer/samples/multi-servicecenters/servicecenter/hello-server/main.go
+++ b/syncer/samples/multi-servicecenters/servicecenter/hello-server/main.go
@@ -56,7 +56,7 @@ func main() {
 	<-stopCh
 }
 
-func start(ctx context.Context, conf *servicecenter.Config)  {
+func start(ctx context.Context, conf *servicecenter.Config) {
 	err := servicecenter.Start(ctx, conf)
 	if err != nil {
 		log.Fatal("register and discovery from servicecenter failed", err)
diff --git a/syncer/servicecenter/storage/operation.go b/syncer/servicecenter/storage/operation.go
index f0325a8..d655afc 100644
--- a/syncer/servicecenter/storage/operation.go
+++ b/syncer/servicecenter/storage/operation.go
@@ -69,4 +69,4 @@ func getAllMappingsOp() clientv3.Op {
 
 func delMappingOp(cluster, mappingID string) clientv3.Op {
 	return clientv3.OpDelete(mappingsKey + "/" + cluster + "/" + mappingID)
-}
\ No newline at end of file
+}
diff --git a/syncer/servicecenter/storage/storage.go b/syncer/servicecenter/storage/storage.go
index 14bf91b..13e3c29 100644
--- a/syncer/servicecenter/storage/storage.go
+++ b/syncer/servicecenter/storage/storage.go
@@ -130,7 +130,7 @@ next:
 		}
 
 		delOp := delMappingOp(entry.ClusterName, entry.OrgInstanceID)
-		if _, err := s.engine.Do(context.Background(),delOp); err != nil {
+		if _, err := s.engine.Do(context.Background(), delOp); err != nil {
 			log.Errorf(err, "Delete instance clusterName=%s instanceID=%s failed", entry.ClusterName, entry.OrgInstanceID)
 		}