nictuku / dht

Kademlia/Mainline DHT node in Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go test ends strangely.

spikebike opened this issue · comments

This should run TestDHTLarge, I updated to the current version just minuts ago?
$ go test

It seems to not complete and expire with a timer. The output should end with:
=== Stats ===
totalReachableNodes:
totalDupes:
totalPeers:
totalSentGetPeers:

Or maybe I misunderstand. Maybe I need to adjust the timers? I'm on a fast machine with a fairly fast network connection (10mbit) without any firewall. I see a fair bit of output, but it doesn't seem to exist normally:

[11/09/12 10:01:41] [TRAC] DHT: Got new node reference: aa9d7b2d164d65ea74588378ab7d898d93dfbbeb@46.172.244.247:49001 from 632b329d713e3641189b1c9fe4420f78f870e210@5.248.242.195:49001. Distance: d749f235cdd12aa4a3cda5625c8d3887285fbd49.
[11/09/12 10:01:41] [TRAC] DHT sending get_peers. nodeID: aa9d7b2d164d65ea74588378ab7d898d93dfbbeb , InfoHash: b462c0a8bcef1ce5bb56b9fdb8cf37ffd02f5f59 , distance: 1effbb85aaa2790fcf0e3a8513b2be7243f0e4b2
[11/09/12 10:01:41] [TRAC] DHT: Got new node reference: d78756c13f577d504599054ee1ee218a2b37d88d@184.154.119.194:27977 from 632b329d713e3641189b1c9fe4420f78f870e210@5.248.242.195:49001. Distance: d749f235cdd12aa4a3cda5625c8d3887285fbd49.
[11/09/12 10:01:41] [TRAC] DHT sending get_peers. nodeID: d78756c13f577d504599054ee1ee218a2b37d88d , InfoHash: b462c0a8bcef1ce5bb56b9fdb8cf37ffd02f5f59 , distance: 63e5966983b861b5fecfbcb359211675fb1887d4
[11/09/12 10:01:46] [WARN] DHT: torrent client asking more peers for d1c5676ae7ac98e8b19f63565905105e3c4c37a2. Calling getPeers().
PASS
ok _/home/bill/tmp/git/dht 9.062s
$

Hey spikebike, Thanks for the report! There are two problems:

  1. You are not running it with "go test -v" so you don't see the test log output. Try repeating it with that command.

  2. but.. even if you ran the test in verbose mode, you're getting flooded by the debugging messages. Sorry about that. I'm fixing this now. Please update your repository after my next commit. Thanks!

# go test -v
=== RUN TestDHTLarge
[11/09/12 20:52:07] [WARN] DHT: torrent client asking more peers for b462c0a8bcef1ce5bb56b9fdb8cf37ffd02f5f59. Calling getPeers().
--- PASS: TestDHTLarge (1.44 seconds)
dht_test.go:75:         Contacted 11 DHT nodes.
dht_test.go:98:         Found 1 peers.
dht_test.go:110:        peer found: 95.132.150.243:50088
                dht_test.go:113:        === Stats ===
dht_test.go:114:        totalReachableNodes: 29
dht_test.go:115:        totalDupes: 1
dht_test.go:116:        totalPeers: 1
dht_test.go:117:        totalSentGetPeers: 235
=== RUN TestCommonBits
--- PASS: TestCommonBits (0.00 seconds)
=== RUN TestUpkeep
--- PASS: TestUpkeep (0.00 seconds)
=== RUN TestNodeDelete
--- PASS: TestNodeDelete (0.00 seconds)
routing_test.go:102:    Removing node: 00
routing_test.go:102:    Removing node: 01
=== RUN TestNodeDistance
--- PASS: TestNodeDistance (0.00 seconds)
=== RUN: ExampleDHT
[11/09/12 20:52:12] [WARN] DHT: torrent client asking more peers for d1c5676ae7ac98e8b19f63565905105e3c4c37a2. Calling getPeers().
--- PASS: ExampleDHT (12.63 seconds)
PASS
ok      github.com/nictuku/dht  14.338s

Please re-open if this is still a problem for you.