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
1be2687d
Unverified
Commit
1be2687d
authored
May 21, 2021
by
Janoš Guljaš
Committed by
GitHub
May 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(pusher): flaky test (#1800)
parent
5ddd07f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
pusher_test.go
pkg/pusher/pusher_test.go
+4
-5
No files found.
pkg/pusher/pusher_test.go
View file @
1be2687d
...
...
@@ -89,6 +89,7 @@ func TestSendChunkToSyncWithTag(t *testing.T) {
mtags
,
p
,
storer
:=
createPusher
(
t
,
triggerPeer
,
pushSyncService
,
mock
.
WithClosestPeer
(
closestPeer
))
defer
storer
.
Close
()
defer
p
.
Close
()
ta
,
err
:=
mtags
.
Create
(
1
)
if
err
!=
nil
{
...
...
@@ -119,8 +120,6 @@ func TestSendChunkToSyncWithTag(t *testing.T) {
if
ta
.
Get
(
tags
.
StateSynced
)
!=
1
{
t
.
Fatalf
(
"tags error"
)
}
p
.
Close
()
}
// TestSendChunkToPushSyncWithoutTag is similar to TestSendChunkToPushSync, excep that the tags are not
...
...
@@ -146,6 +145,7 @@ func TestSendChunkToPushSyncWithoutTag(t *testing.T) {
_
,
p
,
storer
:=
createPusher
(
t
,
triggerPeer
,
pushSyncService
,
mock
.
WithClosestPeer
(
closestPeer
))
defer
storer
.
Close
()
defer
p
.
Close
()
_
,
err
:=
storer
.
Put
(
context
.
Background
(),
storage
.
ModePutUpload
,
chunk
)
if
err
!=
nil
{
...
...
@@ -155,7 +155,7 @@ func TestSendChunkToPushSyncWithoutTag(t *testing.T) {
// Check is the chunk is set as synced in the DB.
for
i
:=
0
;
i
<
noOfRetries
;
i
++
{
// Give some time for chunk to be pushed and receipt to be received
time
.
Sleep
(
1
0
*
time
.
Millisecond
)
time
.
Sleep
(
5
0
*
time
.
Millisecond
)
err
=
checkIfModeSet
(
chunk
.
Address
(),
storage
.
ModeSetSync
,
storer
)
if
err
==
nil
{
...
...
@@ -165,7 +165,6 @@ func TestSendChunkToPushSyncWithoutTag(t *testing.T) {
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
p
.
Close
()
}
// TestSendChunkAndReceiveInvalidReceipt sends a chunk to pushsync to be sent ot its closest peer and
...
...
@@ -184,6 +183,7 @@ func TestSendChunkAndReceiveInvalidReceipt(t *testing.T) {
_
,
p
,
storer
:=
createPusher
(
t
,
triggerPeer
,
pushSyncService
,
mock
.
WithClosestPeer
(
closestPeer
))
defer
storer
.
Close
()
defer
p
.
Close
()
_
,
err
:=
storer
.
Put
(
context
.
Background
(),
storage
.
ModePutUpload
,
chunk
)
if
err
!=
nil
{
...
...
@@ -203,7 +203,6 @@ func TestSendChunkAndReceiveInvalidReceipt(t *testing.T) {
if
err
==
nil
{
t
.
Fatalf
(
"chunk not syned error expected"
)
}
p
.
Close
()
}
// TestSendChunkAndTimeoutinReceivingReceipt sends a chunk to pushsync to be sent ot its closest peer and
...
...
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