Skip to content
Snippets Groups Projects
Commit 938d5edc authored by scott.wang's avatar scott.wang
Browse files

Add more rich unit-test

parent cef0d5dd
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,8 @@ package kubernetes
import (
"encoding/json"
"net/http"
_ "net/http/pprof"
"os"
"strconv"
"testing"
......@@ -238,6 +240,8 @@ func (s *KubernetesRegistryTestSuite) SetupSuite() {
t.Fatal(err)
}
go http.ListenAndServe(":6061", nil)
}
func (s *KubernetesRegistryTestSuite) TestDataChange() {
......
......@@ -135,3 +135,12 @@ func (s *KubernetesRegistryTestSuite) TestNewRegistry() {
t.Fatal("not in cluster, should be a err")
}
}
func (s *KubernetesRegistryTestSuite) TestHandleClientRestart() {
r := s.initRegistry()
r.WaitGroup().Add(1)
go r.HandleClientRestart()
time.Sleep(timeSecondDuration(1))
r.CloseAndNilClient()
}
......@@ -27,7 +27,7 @@ import (
func TestWatchSet(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
s := newWatcherSet(ctx)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment