Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
1c24de2c
Commit
1c24de2c
authored
Mar 04, 2020
by
Dirk McCormick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: clean up tests
parent
b34fe0b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
44 deletions
+0
-44
internal/sessionpeermanager/sessionpeermanager_test.go
internal/sessionpeermanager/sessionpeermanager_test.go
+0
-44
No files found.
internal/sessionpeermanager/sessionpeermanager_test.go
View file @
1c24de2c
...
@@ -36,50 +36,6 @@ func (fpt *fakePeerTagger) UntagPeer(p peer.ID, tag string) {
...
@@ -36,50 +36,6 @@ func (fpt *fakePeerTagger) UntagPeer(p peer.ID, tag string) {
}
}
}
}
func
(
fpt
*
fakePeerTagger
)
count
()
int
{
fpt
.
lk
.
Lock
()
defer
fpt
.
lk
.
Unlock
()
return
len
(
fpt
.
taggedPeers
)
}
// func TestFindingMorePeers(t *testing.T) {
// ctx := context.Background()
// ctx, cancel := context.WithCancel(ctx)
// defer cancel()
// completed := make(chan struct{})
// peers := testutil.GeneratePeers(5)
// fpt := &fakePeerTagger{}
// fppf := &fakePeerProviderFinder{peers, completed}
// c := testutil.GenerateCids(1)[0]
// id := testutil.GenerateSessionID()
// sessionPeerManager := New(ctx, id, fpt, fppf)
// findCtx, findCancel := context.WithTimeout(ctx, 10*time.Millisecond)
// defer findCancel()
// sessionPeerManager.FindMorePeers(ctx, c)
// select {
// case <-completed:
// case <-findCtx.Done():
// t.Fatal("Did not finish finding providers")
// }
// time.Sleep(2 * time.Millisecond)
// sessionPeers := getPeers(sessionPeerManager)
// if len(sessionPeers) != len(peers) {
// t.Fatal("incorrect number of peers found")
// }
// for _, p := range sessionPeers {
// if !testutil.ContainsPeer(peers, p) {
// t.Fatal("incorrect peer found through finding providers")
// }
// }
// if len(fpt.taggedPeers) != len(peers) {
// t.Fatal("Peers were not tagged!")
// }
// }
func
TestAddPeers
(
t
*
testing
.
T
)
{
func
TestAddPeers
(
t
*
testing
.
T
)
{
peers
:=
testutil
.
GeneratePeers
(
2
)
peers
:=
testutil
.
GeneratePeers
(
2
)
spm
:=
New
(
1
,
&
fakePeerTagger
{})
spm
:=
New
(
1
,
&
fakePeerTagger
{})
...
...
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