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

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Wang committed Oct 13, 2017
1 parent a2ae293 commit 80af7ff
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions watch/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (
"github.com/stretchr/testify/assert"
)

// func TestSource1(t *testing.T) {
// for i := 0; i < 1; i++ {
// testSource(t, 30, 25, 20)
// }
// }
func TestSource1(t *testing.T) {
for i := 0; i < 1; i++ {
testSource(t, 30, 25, 20)
}
}

func TestSource2(t *testing.T) {
for i := 0; i < 10; i++ {
Expand Down Expand Up @@ -84,12 +84,15 @@ func testSource(t *testing.T, errAfter int32, closeAfter int32, watchNum int) {
wg.Add(1)
_, w, err := s.Watch()
assert.NoError(t, err)
assert.NotNil(t, w)
c := w.C()
assert.NotNil(t, c)

i := i
go func() {
var v interface{}
count := 0
for range w.C() {
for range c {
if v != nil {
assert.True(t, w.Get().(int32) >= v.(int32))
}
Expand Down

0 comments on commit 80af7ff

Please sign in to comment.