Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestNodeClose Fails w/o Network Device #1524

Closed
terencechain opened this issue Feb 8, 2019 · 0 comments
Closed

TestNodeClose Fails w/o Network Device #1524

terencechain opened this issue Feb 8, 2019 · 0 comments
Labels
Bug Something isn't working

Comments

@terencechain
Copy link
Member

TestNodeClose in node_test.go will fail if you detach the network device.

How to reproduce:
1.) With proper network connection, run the test, make sure it passes
2.) Disable network device, make one change to the code, rerun test
3.) TestNodeClose will fail with the following messages

=== RUN   TestNodeClose
time="2019-02-08T15:53:45+01:00" level=info msg="checking db" prefix=node
time="2019-02-08T15:53:45+01:00" level=error msg="Could not get IPv4 address: are you connected to the network?" prefix=p2p
time="2019-02-08T15:53:45+01:00" level=error msg="Failed to p2p listen: failed to parse ip4:  failed to parse ip4 addr: " prefix=p2p
time="2019-02-08T15:53:45+01:00" level=error msg="Could not get IPv4 address: are you connected to the network?" prefix=p2p
--- FAIL: TestNodeClose (0.14s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x4825f75]

goroutine 40 [running]:
testing.tRunner.func1(0xc000448600)
	/usr/local/Cellar/go/1.11.4/libexec/src/testing/testing.go:792 +0x387
panic(0x4b8e040, 0x592d8e0)
	/usr/local/Cellar/go/1.11.4/libexec/src/runtime/panic.go:513 +0x1b9
github.com/libp2p/go-libp2p-swarm.(*Swarm).TransportForListening(0xc0001e4000, 0x0, 0x0, 0x0, 0x0)
	/Users/terencetsao/go/src/github.com/libp2p/go-libp2p-swarm/swarm_transport.go:42 +0x45
github.com/libp2p/go-libp2p-swarm.(*Swarm).AddListenAddr(0xc0001e4000, 0x0, 0x0, 0xc000134160, 0x1)
	/Users/terencetsao/go/src/github.com/libp2p/go-libp2p-swarm/swarm_listen.go:39 +0x4c
github.com/libp2p/go-libp2p-swarm.(*Swarm).Listen(0xc0001e4000, 0xc00016d0c0, 0x1, 0x1, 0xc0000aa740, 0x0)
	/Users/terencetsao/go/src/github.com/libp2p/go-libp2p-swarm/swarm_listen.go:16 +0x347
github.com/libp2p/go-libp2p/config.(*Config).NewNode(0xc000170b40, 0x4f5c2c0, 0xc00017afc0, 0x4, 0x0, 0x0, 0xc000167880)
	/Users/terencetsao/go/src/github.com/libp2p/go-libp2p/config/config.go:166 +0x4f3
github.com/libp2p/go-libp2p.NewWithoutDefaults(0x4f5c2c0, 0xc00017afc0, 0xc000167880, 0x3, 0x4, 0xc000167880, 0x2, 0x4, 0x5995a40)
	/Users/terencetsao/go/src/github.com/libp2p/go-libp2p/libp2p.go:68 +0xb5
github.com/libp2p/go-libp2p.New(0x4f5c2c0, 0xc00017afc0, 0xc00016ce40, 0x2, 0x2, 0x3, 0xc000044a70, 0xc000044a00, 0x0)
	/Users/terencetsao/go/src/github.com/libp2p/go-libp2p/libp2p.go:54 +0x7c
github.com/prysmaticlabs/prysm/shared/p2p.NewServer(0xc0004cfdb8, 0x4d0d260, 0x8, 0x0)
	/Users/terencetsao/go/src/github.com/prysmaticlabs/prysm/shared/p2p/service.go:63 +0x118
github.com/prysmaticlabs/prysm/beacon-chain/node.configureP2P(0xc0004462c0, 0x0, 0xc000180320, 0x4b254e0)
	/Users/terencetsao/go/src/github.com/prysmaticlabs/prysm/beacon-chain/node/p2p_config.go:28 +0x152
github.com/prysmaticlabs/prysm/beacon-chain/node.(*BeaconNode).registerP2P(0xc00017acc0, 0xc0004462c0, 0x0, 0x0)
	/Users/terencetsao/go/src/github.com/prysmaticlabs/prysm/beacon-chain/node/node.go:167 +0x2f
github.com/prysmaticlabs/prysm/beacon-chain/node.NewBeaconNode(0xc0004462c0, 0xc0004462c0, 0xb, 0xc000450101)
	/Users/terencetsao/go/src/github.com/prysmaticlabs/prysm/beacon-chain/node/node.go:69 +0x14b
github.com/prysmaticlabs/prysm/beacon-chain/node.TestNodeClose(0xc000448600)
	/Users/terencetsao/go/src/github.com/prysmaticlabs/prysm/beacon-chain/node/node_test.go:63 +0x24c
testing.tRunner(0xc000448600, 0x4e82c58)
	/usr/local/Cellar/go/1.11.4/libexec/src/testing/testing.go:827 +0xbf
created by testing.(*T).Run
	/usr/local/Cellar/go/1.11.4/libexec/src/testing/testing.go:878 +0x35c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant