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
p2p
go-p2p-kad-dht
Commits
d323f32b
Commit
d323f32b
authored
Sep 13, 2016
by
Jeromy Johnson
Committed by
GitHub
Sep 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8 from libp2p/feat/go-vet
fix go vet issues and add go vet to CI scripts
parents
02dc9400
49aab9a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
.travis.yml
.travis.yml
+2
-1
dht_test.go
dht_test.go
+5
-5
No files found.
.travis.yml
View file @
d323f32b
...
@@ -11,6 +11,7 @@ install: true
...
@@ -11,6 +11,7 @@ install: true
script
:
script
:
-
make deps
-
make deps
-
go vet
-
go test ./...
-
go test ./...
cache
:
cache
:
...
@@ -18,4 +19,4 @@ cache:
...
@@ -18,4 +19,4 @@ cache:
-
$GOPATH/src/gx
-
$GOPATH/src/gx
notifications
:
notifications
:
email
:
false
email
:
false
\ No newline at end of file
dht_test.go
View file @
d323f32b
...
@@ -323,7 +323,7 @@ func TestBootstrap(t *testing.T) {
...
@@ -323,7 +323,7 @@ func TestBootstrap(t *testing.T) {
stop
:=
make
(
chan
struct
{})
stop
:=
make
(
chan
struct
{})
go
func
()
{
go
func
()
{
for
{
for
{
t
.
Logf
(
"bootstrapping them so they find each other"
,
nDHTs
)
t
.
Logf
(
"bootstrapping them so they find each other
%d
"
,
nDHTs
)
ctxT
,
_
:=
context
.
WithTimeout
(
ctx
,
5
*
time
.
Second
)
ctxT
,
_
:=
context
.
WithTimeout
(
ctx
,
5
*
time
.
Second
)
bootstrap
(
t
,
ctxT
,
dhts
)
bootstrap
(
t
,
ctxT
,
dhts
)
...
@@ -392,7 +392,7 @@ func TestPeriodicBootstrap(t *testing.T) {
...
@@ -392,7 +392,7 @@ func TestPeriodicBootstrap(t *testing.T) {
}
}
go
amplify
(
signal
,
allSignals
)
go
amplify
(
signal
,
allSignals
)
t
.
Logf
(
"dhts are not connected."
,
nDHTs
)
t
.
Logf
(
"dhts are not connected.
%d
"
,
nDHTs
)
for
_
,
dht
:=
range
dhts
{
for
_
,
dht
:=
range
dhts
{
rtlen
:=
dht
.
routingTable
.
Size
()
rtlen
:=
dht
.
routingTable
.
Size
()
if
rtlen
>
0
{
if
rtlen
>
0
{
...
@@ -404,7 +404,7 @@ func TestPeriodicBootstrap(t *testing.T) {
...
@@ -404,7 +404,7 @@ func TestPeriodicBootstrap(t *testing.T) {
connect
(
t
,
ctx
,
dhts
[
i
],
dhts
[(
i
+
1
)
%
len
(
dhts
)])
connect
(
t
,
ctx
,
dhts
[
i
],
dhts
[(
i
+
1
)
%
len
(
dhts
)])
}
}
t
.
Logf
(
"DHTs are now connected to 1-2 others."
,
nDHTs
)
t
.
Logf
(
"DHTs are now connected to 1-2 others.
%d
"
,
nDHTs
)
for
_
,
dht
:=
range
dhts
{
for
_
,
dht
:=
range
dhts
{
rtlen
:=
dht
.
routingTable
.
Size
()
rtlen
:=
dht
.
routingTable
.
Size
()
if
rtlen
>
2
{
if
rtlen
>
2
{
...
@@ -416,7 +416,7 @@ func TestPeriodicBootstrap(t *testing.T) {
...
@@ -416,7 +416,7 @@ func TestPeriodicBootstrap(t *testing.T) {
printRoutingTables
(
dhts
)
printRoutingTables
(
dhts
)
}
}
t
.
Logf
(
"bootstrapping them so they find each other"
,
nDHTs
)
t
.
Logf
(
"bootstrapping them so they find each other
. %d
"
,
nDHTs
)
signal
<-
time
.
Now
()
signal
<-
time
.
Now
()
// this is async, and we dont know when it's finished with one cycle, so keep checking
// this is async, and we dont know when it's finished with one cycle, so keep checking
...
@@ -448,7 +448,7 @@ func TestProvidesMany(t *testing.T) {
...
@@ -448,7 +448,7 @@ func TestProvidesMany(t *testing.T) {
}
}
<-
time
.
After
(
100
*
time
.
Millisecond
)
<-
time
.
After
(
100
*
time
.
Millisecond
)
t
.
Logf
(
"bootstrapping them so they find each other"
,
nDHTs
)
t
.
Logf
(
"bootstrapping them so they find each other
. %d
"
,
nDHTs
)
ctxT
,
_
:=
context
.
WithTimeout
(
ctx
,
20
*
time
.
Second
)
ctxT
,
_
:=
context
.
WithTimeout
(
ctx
,
20
*
time
.
Second
)
bootstrap
(
t
,
ctxT
,
dhts
)
bootstrap
(
t
,
ctxT
,
dhts
)
...
...
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