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
0638fbe7
Unverified
Commit
0638fbe7
authored
Nov 03, 2020
by
acud
Committed by
GitHub
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
increase timeout before mining the chunk (#906)
parent
d21bd495
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
pss_test.go
pkg/api/pss_test.go
+11
-8
No files found.
pkg/api/pss_test.go
View file @
0638fbe7
...
@@ -30,11 +30,12 @@ import (
...
@@ -30,11 +30,12 @@ import (
)
)
var
(
var
(
target
=
pss
.
Target
([]
byte
{
1
})
target
=
pss
.
Target
([]
byte
{
1
})
targets
=
pss
.
Targets
([]
pss
.
Target
{
target
})
targets
=
pss
.
Targets
([]
pss
.
Target
{
target
})
payload
=
[]
byte
(
"testdata"
)
payload
=
[]
byte
(
"testdata"
)
topic
=
pss
.
NewTopic
(
"testtopic"
)
topic
=
pss
.
NewTopic
(
"testtopic"
)
timeout
=
10
*
time
.
Second
timeout
=
10
*
time
.
Second
longTimeout
=
30
*
time
.
Second
)
)
// creates a single websocket handler for an arbitrary topic, and receives a message
// creates a single websocket handler for an arbitrary topic, and receives a message
...
@@ -48,7 +49,9 @@ func TestPssWebsocketSingleHandler(t *testing.T) {
...
@@ -48,7 +49,9 @@ func TestPssWebsocketSingleHandler(t *testing.T) {
done
=
make
(
chan
struct
{})
done
=
make
(
chan
struct
{})
)
)
err
:=
cl
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
timeout
))
// the long timeout is needed so that we dont time out while still mining the message with Wrap()
// otherwise the test (and other tests below) flakes
err
:=
cl
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
longTimeout
))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
@@ -80,7 +83,7 @@ func TestPssWebsocketSingleHandlerDeregister(t *testing.T) {
...
@@ -80,7 +83,7 @@ func TestPssWebsocketSingleHandlerDeregister(t *testing.T) {
done
=
make
(
chan
struct
{})
done
=
make
(
chan
struct
{})
)
)
err
:=
cl
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
t
imeout
))
err
:=
cl
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
longT
imeout
))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
...
@@ -122,7 +125,7 @@ func TestPssWebsocketMultiHandler(t *testing.T) {
...
@@ -122,7 +125,7 @@ func TestPssWebsocketMultiHandler(t *testing.T) {
t
.
Fatalf
(
"dial: %v. url %v"
,
err
,
u
.
String
())
t
.
Fatalf
(
"dial: %v. url %v"
,
err
,
u
.
String
())
}
}
err
=
cl
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
t
imeout
))
err
=
cl
.
SetReadDeadline
(
time
.
Now
()
.
Add
(
longT
imeout
))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
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