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
abd00984
Unverified
Commit
abd00984
authored
Mar 24, 2021
by
Alok Nerurkar
Committed by
GitHub
Mar 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PSS API Test flakiness fix (#1480)
* Minor fix for API PSS tests
parent
08c92e90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
pss_test.go
pkg/api/pss_test.go
+13
-7
No files found.
pkg/api/pss_test.go
View file @
abd00984
...
...
@@ -30,11 +30,17 @@ import (
)
var
(
target
=
pss
.
Target
([]
byte
{
1
})
targets
=
pss
.
Targets
([]
pss
.
Target
{
target
})
payload
=
[]
byte
(
"testdata"
)
topic
=
pss
.
NewTopic
(
"testtopic"
)
timeout
=
10
*
time
.
Second
target
=
pss
.
Target
([]
byte
{
1
})
targets
=
pss
.
Targets
([]
pss
.
Target
{
target
})
payload
=
[]
byte
(
"testdata"
)
topic
=
pss
.
NewTopic
(
"testtopic"
)
// mTimeout is used to wait for checking the message contents, whereas rTimeout
// is used to wait for reading the message. For the negative cases, i.e. ensuring
// no message is received, the rTimeout might trigger before the mTimeout
// (Issue #1388) causing test to fail. Hence the rTimeout should be slightly more
// than the mTimeout
mTimeout
=
10
*
time
.
Second
rTimeout
=
15
*
time
.
Second
longTimeout
=
30
*
time
.
Second
)
...
...
@@ -282,7 +288,7 @@ func TestPssPingPong(t *testing.T) {
func
waitReadMessage
(
t
*
testing
.
T
,
mtx
*
sync
.
Mutex
,
cl
*
websocket
.
Conn
,
targetContent
[]
byte
,
done
<-
chan
struct
{})
{
t
.
Helper
()
timeout
:=
time
.
After
(
t
imeout
)
timeout
:=
time
.
After
(
rT
imeout
)
for
{
select
{
case
<-
done
:
...
...
@@ -327,7 +333,7 @@ func waitDone(t *testing.T, mtx *sync.Mutex, done *bool) {
func
waitMessage
(
t
*
testing
.
T
,
data
,
expData
[]
byte
,
mtx
*
sync
.
Mutex
)
{
t
.
Helper
()
ttl
:=
time
.
After
(
t
imeout
)
ttl
:=
time
.
After
(
mT
imeout
)
for
{
select
{
case
<-
ttl
:
...
...
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