Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
f2d976f6
Commit
f2d976f6
authored
Feb 04, 2020
by
Janos Guljas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust timings in p2p/protobuf tests
parent
cc9ff2df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
protobuf_test.go
pkg/p2p/protobuf/protobuf_test.go
+12
-12
No files found.
pkg/p2p/protobuf/protobuf_test.go
View file @
f2d976f6
...
...
@@ -74,7 +74,7 @@ func TestReader_timeout(t *testing.T) {
{
name
:
"NewReader"
,
readerFunc
:
func
()
protobuf
.
Reader
{
return
protobuf
.
NewReader
(
newMessageReader
(
messages
,
2
00
*
time
.
Millisecond
))
return
protobuf
.
NewReader
(
newMessageReader
(
messages
,
4
00
*
time
.
Millisecond
))
},
},
{
...
...
@@ -82,7 +82,7 @@ func TestReader_timeout(t *testing.T) {
readerFunc
:
func
()
protobuf
.
Reader
{
_
,
r
:=
protobuf
.
NewWriterAndReader
(
newNoopWriteCloser
(
newMessageReader
(
messages
,
2
00
*
time
.
Millisecond
),
newMessageReader
(
messages
,
4
00
*
time
.
Millisecond
),
),
)
return
r
...
...
@@ -96,9 +96,9 @@ func TestReader_timeout(t *testing.T) {
for
i
:=
0
;
i
<
len
(
messages
);
i
++
{
var
timeout
time
.
Duration
if
i
==
0
{
timeout
=
3
00
*
time
.
Millisecond
timeout
=
6
00
*
time
.
Millisecond
}
else
{
timeout
=
1
00
*
time
.
Millisecond
timeout
=
2
00
*
time
.
Millisecond
}
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
timeout
)
defer
cancel
()
...
...
@@ -126,9 +126,9 @@ func TestReader_timeout(t *testing.T) {
for
i
:=
0
;
i
<
len
(
messages
);
i
++
{
var
timeout
time
.
Duration
if
i
==
0
{
timeout
=
3
00
*
time
.
Millisecond
timeout
=
6
00
*
time
.
Millisecond
}
else
{
timeout
=
1
00
*
time
.
Millisecond
timeout
=
2
00
*
time
.
Millisecond
}
err
:=
r
.
ReadMsgWithTimeout
(
timeout
,
&
msg
)
if
i
==
0
{
...
...
@@ -203,14 +203,14 @@ func TestWriter_timeout(t *testing.T) {
{
name
:
"NewWriter"
,
writerFunc
:
func
()
(
protobuf
.
Writer
,
<-
chan
string
)
{
w
,
msgs
:=
newMessageWriter
(
2
00
*
time
.
Millisecond
)
w
,
msgs
:=
newMessageWriter
(
4
00
*
time
.
Millisecond
)
return
protobuf
.
NewWriter
(
w
),
msgs
},
},
{
name
:
"NewWriterAndReader"
,
writerFunc
:
func
()
(
protobuf
.
Writer
,
<-
chan
string
)
{
w
,
msgs
:=
newMessageWriter
(
2
00
*
time
.
Millisecond
)
w
,
msgs
:=
newMessageWriter
(
4
00
*
time
.
Millisecond
)
writer
,
_
:=
protobuf
.
NewWriterAndReader
(
newNoopReadCloser
(
w
))
return
writer
,
msgs
},
...
...
@@ -223,9 +223,9 @@ func TestWriter_timeout(t *testing.T) {
for
i
,
m
:=
range
messages
{
var
timeout
time
.
Duration
if
i
==
0
{
timeout
=
3
00
*
time
.
Millisecond
timeout
=
6
00
*
time
.
Millisecond
}
else
{
timeout
=
1
00
*
time
.
Millisecond
timeout
=
2
00
*
time
.
Millisecond
}
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
timeout
)
defer
cancel
()
...
...
@@ -253,9 +253,9 @@ func TestWriter_timeout(t *testing.T) {
for
i
,
m
:=
range
messages
{
var
timeout
time
.
Duration
if
i
==
0
{
timeout
=
3
00
*
time
.
Millisecond
timeout
=
6
00
*
time
.
Millisecond
}
else
{
timeout
=
1
00
*
time
.
Millisecond
timeout
=
2
00
*
time
.
Millisecond
}
err
:=
w
.
WriteMsgWithTimeout
(
timeout
,
&
pb
.
Message
{
Text
:
m
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment