Commit 5215ac36 authored by Janoš Guljaš's avatar Janoš Guljaš Committed by GitHub

adjust tests timings in protobuf package (#863)

parent 37ace1f9
...@@ -75,7 +75,7 @@ func TestReader_timeout(t *testing.T) { ...@@ -75,7 +75,7 @@ func TestReader_timeout(t *testing.T) {
{ {
name: "NewReader", name: "NewReader",
readerFunc: func() protobuf.Reader { readerFunc: func() protobuf.Reader {
return protobuf.NewReader(newMessageReader(messages, 100*time.Millisecond)) return protobuf.NewReader(newMessageReader(messages, 500*time.Millisecond))
}, },
}, },
{ {
...@@ -83,7 +83,7 @@ func TestReader_timeout(t *testing.T) { ...@@ -83,7 +83,7 @@ func TestReader_timeout(t *testing.T) {
readerFunc: func() protobuf.Reader { readerFunc: func() protobuf.Reader {
_, r := protobuf.NewWriterAndReader( _, r := protobuf.NewWriterAndReader(
newNoopWriteCloser( newNoopWriteCloser(
newMessageReader(messages, 100*time.Millisecond), newMessageReader(messages, 500*time.Millisecond),
), ),
) )
return r return r
...@@ -97,7 +97,7 @@ func TestReader_timeout(t *testing.T) { ...@@ -97,7 +97,7 @@ func TestReader_timeout(t *testing.T) {
for i := 0; i < len(messages); i++ { for i := 0; i < len(messages); i++ {
var timeout time.Duration var timeout time.Duration
if i == 0 { if i == 0 {
timeout = 600 * time.Millisecond timeout = 1000 * time.Millisecond
} else { } else {
timeout = 10 * time.Millisecond timeout = 10 * time.Millisecond
} }
...@@ -176,14 +176,14 @@ func TestWriter_timeout(t *testing.T) { ...@@ -176,14 +176,14 @@ func TestWriter_timeout(t *testing.T) {
{ {
name: "NewWriter", name: "NewWriter",
writerFunc: func() (protobuf.Writer, <-chan string) { writerFunc: func() (protobuf.Writer, <-chan string) {
w, msgs := newMessageWriter(100 * time.Millisecond) w, msgs := newMessageWriter(500 * time.Millisecond)
return protobuf.NewWriter(w), msgs return protobuf.NewWriter(w), msgs
}, },
}, },
{ {
name: "NewWriterAndReader", name: "NewWriterAndReader",
writerFunc: func() (protobuf.Writer, <-chan string) { writerFunc: func() (protobuf.Writer, <-chan string) {
w, msgs := newMessageWriter(100 * time.Millisecond) w, msgs := newMessageWriter(500 * time.Millisecond)
writer, _ := protobuf.NewWriterAndReader(newNoopReadCloser(w)) writer, _ := protobuf.NewWriterAndReader(newNoopReadCloser(w))
return writer, msgs return writer, msgs
}, },
...@@ -196,7 +196,7 @@ func TestWriter_timeout(t *testing.T) { ...@@ -196,7 +196,7 @@ func TestWriter_timeout(t *testing.T) {
for i, m := range messages { for i, m := range messages {
var timeout time.Duration var timeout time.Duration
if i == 0 { if i == 0 {
timeout = 600 * time.Millisecond timeout = 1000 * time.Millisecond
} else { } else {
timeout = 10 * time.Millisecond timeout = 10 * time.Millisecond
} }
......
Markdown is supported
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