{"action":"created","issue":{"url":"https://api.github.com/repos/copernet/copernicus/issues/212","repository_url":"https://api.github.com/repos/copernet/copernicus","labels_url":"https://api.github.com/repos/copernet/copernicus/issues/212/labels{/name}","comments_url":"https://api.github.com/repos/copernet/copernicus/issues/212/comments","events_url":"https://api.github.com/repos/copernet/copernicus/issues/212/events","html_url":"https://github.com/copernet/copernicus/issues/212","id":388221082,"node_id":"MDU6SXNzdWUzODgyMjEwODI=","number":212,"title":"unittest in ./check.sh failed, when there is a Copernicus running on localhost","user":{"login":"whunmr","id":1876615,"node_id":"MDQ6VXNlcjE4NzY2MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1876615?v=4","gravatar_id":"","url":"https://api.github.com/users/whunmr","html_url":"https://github.com/whunmr","followers_url":"https://api.github.com/users/whunmr/followers","following_url":"https://api.github.com/users/whunmr/following{/other_user}","gists_url":"https://api.github.com/users/whunmr/gists{/gist_id}","starred_url":"https://api.github.com/users/whunmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whunmr/subscriptions","organizations_url":"https://api.github.com/users/whunmr/orgs","repos_url":"https://api.github.com/users/whunmr/repos","events_url":"https://api.github.com/users/whunmr/events{/privacy}","received_events_url":"https://api.github.com/users/whunmr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-06T13:47:12Z","updated_at":"2018-12-08T03:05:00Z","closed_at":"2018-12-08T03:05:00Z","author_association":"CONTRIBUTOR","body":"**Describe the bug**\r\nunittest in ./check.sh failed, when there is a copernicus is running on localhost\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1.  start a copernicus instance on localhost with default mainnet parameter\r\n2. running ./check.sh\r\n\r\n**Additional context**\r\n```\r\n| => ./check.sh 2>&1 | grep -v \"ld: warning: text-based stub file\"\r\n++ type -p glide\r\n+ '[' '!' -x /usr/local/bin/glide ']'\r\n++ type -p gometalinter\r\n+ '[' '!' -x /Users/bj1809120051/.go/bin/gometalinter ']'\r\n+ find . -name '*.go' -not -path './vendor/*' -not -path './git/*'\r\n+ xargs gofmt -w\r\n++ glide novendor\r\n+ linter_targets='./crypto/...\r\n./tools/...\r\n./net/...\r\n./util/...\r\n./logic/...\r\n./peer/...\r\n./model/...\r\n./log/...\r\n./service/...\r\n./rpc/...\r\n./conf/...\r\n./persist/...\r\n./errcode/...\r\n.'\r\n++ gometalinter -j 4 --disable-all --enable=gofmt --enable=golint --enable=gosimple --enable=ineffassign --enable=vet --enable=misspell --enable=unconvert '--exclude=should have comment' '--exclude=and that stutters;' --deadline=10m ./crypto/... ./tools/... ./net/... ./util/... ./logic/... ./peer/... ./model/... ./log/... ./service/... ./rpc/... ./conf/... ./persist/... ./errcode/... .\r\n++ grep -v 'ALL_CAPS\\|OP_'\r\n++ tee /dev/stderr\r\n+ test -z ''\r\n+ go test -covermode=atomic -coverprofile=coverage.out -race -tags rpctest ./crypto/... ./tools/... ./net/... ./util/... ./logic/... ./peer/... ./model/... ./log/... ./service/... ./rpc/... ./conf/... ./persist/... ./errcode/... .\r\n# github.com/copernet/copernicus/logic/lmerkleroot.test\r\n# github.com/copernet/copernicus/model/txin.test\r\n# github.com/copernet/copernicus/crypto.test\r\n# github.com/copernet/copernicus/net/addrmgr.test\r\n# github.com/copernet/copernicus/model/script.test\r\n# github.com/copernet/copernicus/net/connmgr.test\r\n# github.com/copernet/copernicus/util/cashaddr.test\r\n# github.com/copernet/copernicus/util/bloom.test\r\n# github.com/copernet/copernicus/util/wif.test\r\n# github.com/copernet/copernicus/net/syncmanager.test\r\n# github.com/copernet/copernicus/net/wire.test\r\n# github.com/copernet/copernicus/logic/lblock.test\r\n# github.com/copernet/copernicus/net/server.test\r\n# github.com/copernet/copernicus/logic/lblockindex.test\r\nok  \tgithub.com/copernet/copernicus/crypto\t10.080s\tcoverage: 77.1% of statements\r\n?   \tgithub.com/copernet/copernicus/tools/blockanalyse\t[no test files]\r\n?   \tgithub.com/copernet/copernicus/tools/coperctl\t[no test files]\r\n# github.com/copernet/copernicus/logic/lchain.test\r\n# github.com/copernet/copernicus/logic/lmempool.test\r\n# github.com/copernet/copernicus/logic/lmerkleblock.test\r\n# github.com/copernet/copernicus/logic/lscript.test\r\n# github.com/copernet/copernicus/logic/lreindex.test\r\nok  \tgithub.com/copernet/copernicus/net/addrmgr\t20.027s\tcoverage: 83.5% of statements\r\nok  \tgithub.com/copernet/copernicus/net/connmgr\t10.962s\tcoverage: 88.0% of statements\r\nok  \tgithub.com/copernet/copernicus/net/limits\t1.337s\tcoverage: 26.3% of statements\r\n# github.com/copernet/copernicus/logic/lundo.test\r\n# github.com/copernet/copernicus/model/block.test\r\n# github.com/copernet/copernicus/logic/ltx.test\r\n# github.com/copernet/copernicus/model.test\r\n# github.com/copernet/copernicus/model/blockindex.test\r\nok  \tgithub.com/copernet/copernicus/net/server\t17.292s\tcoverage: 72.7% of statements\r\n?   \tgithub.com/copernet/copernicus/net/socks\t[no test files]\r\nok  \tgithub.com/copernet/copernicus/net/syncmanager\t13.897s\tcoverage: 80.8% of statements\r\n?   \tgithub.com/copernet/copernicus/net/upnp\t[no test files]\r\nok  \tgithub.com/copernet/copernicus/net/wire\t10.792s\tcoverage: 87.8% of statements\r\nok  \tgithub.com/copernet/copernicus/util\t14.845s\tcoverage: 90.8% of statements\r\n?   \tgithub.com/copernet/copernicus/util/algorithm/mapcontainer\t[no test files]\r\nok  \tgithub.com/copernet/copernicus/util/algorithm/mapcontainer/skiplist\t4.297s\tcoverage: 100.0% of statements\r\nok  \tgithub.com/copernet/copernicus/util/amount\t11.421s\tcoverage: 95.7% of statements\r\nok  \tgithub.com/copernet/copernicus/util/base58\t1.256s\tcoverage: 100.0% of statements\r\nok  \tgithub.com/copernet/copernicus/util/bloom\t9.533s\tcoverage: 86.5% of statements\r\nok  \tgithub.com/copernet/copernicus/util/cashaddr\t8.880s\tcoverage: 80.7% of statements\r\nok  \tgithub.com/copernet/copernicus/util/wif\t9.861s\tcoverage: 81.0% of statements\r\n# github.com/copernet/copernicus/model/chain.test\r\nok  \tgithub.com/copernet/copernicus/logic/lblock\t19.555s\tcoverage: 60.5% of statements\r\nok  \tgithub.com/copernet/copernicus/logic/lblockindex\t10.592s\tcoverage: 84.5% of statements\r\n# github.com/copernet/copernicus/peer.test\r\nok  \tgithub.com/copernet/copernicus/logic/lchain\t14.419s\tcoverage: 79.1% of statements\r\n# github.com/copernet/copernicus/model/pow.test\r\nok  \tgithub.com/copernet/copernicus/logic/lmempool\t16.248s\tcoverage: 79.8% of statements\r\nok  \tgithub.com/copernet/copernicus/logic/lmerkleblock\t1.510s\tcoverage: 84.2% of statements\r\nok  \tgithub.com/copernet/copernicus/logic/lmerkleroot\t2.211s\tcoverage: 89.2% of statements\r\nok  \tgithub.com/copernet/copernicus/logic/lreindex\t1.446s\tcoverage: 85.3% of statements\r\nok  \tgithub.com/copernet/copernicus/logic/lscript\t2.888s\tcoverage: 84.2% of statements\r\n# github.com/copernet/copernicus/model/tx.test\r\n# github.com/copernet/copernicus/model/txout.test\r\n# github.com/copernet/copernicus/model/undo.test\r\n# github.com/copernet/copernicus/model/utxo.test\r\n# github.com/copernet/copernicus/model/versionbits.test\r\n# github.com/copernet/copernicus/service.test\r\n# github.com/copernet/copernicus/service/mining.test\r\n# github.com/copernet/copernicus/persist.test\r\n# github.com/copernet/copernicus/persist/blkdb.test\r\n# github.com/copernet/copernicus/persist/disk.test\r\n# github.com/copernet/copernicus/model/mempool.test\r\nok  \tgithub.com/copernet/copernicus/logic/ltx\t35.545s\tcoverage: 86.1% of statements\r\nok  \tgithub.com/copernet/copernicus/logic/lundo\t8.759s\tcoverage: 85.1% of statements\r\n?   \tgithub.com/copernet/copernicus/logic/lwallet\t[no test files]\r\n2018/12/06 21:42:19.399 [D]  AddToIndexMap:000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f index height:0\r\n2018/12/06 21:42:19.400 [D]  &{GoVersion:1.9.2 Version:1.0.0 BuildDate:20180428 DataDir:/Users/bj1809120051/Library/Application Support/Bitcoincash Reindex:false Excessiveblocksize:32000000 RPC:{RPCListeners:[127.0.0.1:18334] RPCUser:copernicus RPCPass:doXT3DXgAQCNU0Li0pujQ6zR3Y RPCLimitUser: RPCLimitPass: RPCCert:/Users/bj1809120051/Library/Application Support/Bitcoincash/rpc.cert RPCKey:/Users/bj1809120051/Library/Application Support/Bitcoincash/rpc.key RPCMaxClients:1000 RPCMaxWebsockets:0 RPCMaxConcurrentReqs:0 RPCQuirks:false} Log:{Level:error Module:[mempool utxo bench service] FileName:copernicus} Mempool:{MinFeeRate:0 LimitAncestorCount:50000 LimitAncestorSize:5000 LimitDescendantCount:50000 LimitDescendantSize:5000 MaxPoolSize:300000000 MaxPoolExpiry:336 CheckFrequency:4294967296} P2PNet:{ListenAddrs:[127.0.0.1:18333] MaxPeers:128 TargetOutbound:64 ConnectPeersOnStart:[] DisableBanning:true BanThreshold:100 TestNet:false RegTest:false SimNet:false DisableListen:false BlocksOnly:false BanDuration:86400 Proxy: UserAgentComments:[] DisableDNSSeed:false DisableRPC:false DisableTLS:false Whitelists:[] NoOnion:true Upnp:false ExternalIPs:[] MaxTimeAdjustment:4200} AddrMgr:{SimNet:false ConnectPeers:[]} Protocol:{NoPeerBloomFilters:true DisableCheckpoints:true} Script:{AcceptDataCarrier:true MaxDatacarrierBytes:223 IsBareMultiSigStd:true PromiscuousMempoolFlags: Par:32} TxOut:{DustRelayFee:83} Chain:{AssumeValid: UtxoHashStartHeight:-1 UtxoHashEndHeight:-1} Mining:{BlockMinTxFee:100 BlockMaxSize:2000000 Strategy:ancestorfeerate} PProf:{IP:localhost Port:6060} BlockIndex:{CheckBlockIndex:false} Wallet:{Enable:false Broadcast:false SpendZeroConfChange:true}}\r\n2018/12/06 21:42:19.402 [E]  Can't listen on 127.0.0.1:18333: listen tcp4 127.0.0.1:18333: bind: address already in use\r\npanic: server init fail\r\n\r\ngoroutine 1 [running]:\r\ngithub.com/copernet/copernicus/peer_test.initEnv()\r\n\t/Users/bj1809120051/.go/src/github.com/copernet/copernicus/peer/peer_test.go:265 +0xb71\r\ngithub.com/copernet/copernicus/peer_test.TestMain(0xc000125300)\r\n\t/Users/bj1809120051/.go/src/github.com/copernet/copernicus/peer/peer_test.go:52 +0x89\r\nmain.main()\r\n\t_testmain.go:116 +0x32f\r\nFAIL\tgithub.com/copernet/copernicus/peer\t10.536s\r\nok  \tgithub.com/copernet/copernicus/model\t9.843s\tcoverage: 87.2% of statements\r\nok  \tgithub.com/copernet/copernicus/model/block\t8.745s\tcoverage: 84.8% of statements\r\nok  \tgithub.com/copernet/copernicus/model/blockindex\t56.925s\tcoverage: 77.9% of statements\r\nok  \tgithub.com/copernet/copernicus/model/chain\t11.324s\tcoverage: 79.7% of statements\r\nok  \tgithub.com/copernet/copernicus/model/consensus\t7.979s\tcoverage: 100.0% of statements\r\nok  \tgithub.com/copernet/copernicus/model/mempool\t1.546s\tcoverage: 83.6% of statements\r\nok  \tgithub.com/copernet/copernicus/model/opcodes\t1.297s\tcoverage: 90.3% of statements\r\nok  \tgithub.com/copernet/copernicus/model/outpoint\t11.491s\tcoverage: 100.0% of statements\r\nok  \tgithub.com/copernet/copernicus/model/pow\t11.744s\tcoverage: 81.5% of statements\r\nok  \tgithub.com/copernet/copernicus/model/script\t1.597s\tcoverage: 87.4% of statements\r\nok  \tgithub.com/copernet/copernicus/model/tx\t13.628s\tcoverage: 78.2% of statements\r\nok  \tgithub.com/copernet/copernicus/model/txin\t9.057s\tcoverage: 100.0% of statements\r\nok  \tgithub.com/copernet/copernicus/model/txout\t3.709s\tcoverage: 86.7% of statements\r\nok  \tgithub.com/copernet/copernicus/model/undo\t10.272s\tcoverage: 96.8% of statements\r\nok  \tgithub.com/copernet/copernicus/model/utxo\t2.500s\tcoverage: 80.2% of statements\r\nok  \tgithub.com/copernet/copernicus/model/versionbits\t1.510s\tcoverage: 6.7% of statements\r\n?   \tgithub.com/copernet/copernicus/model/wallet\t[no test files]\r\nok  \tgithub.com/copernet/copernicus/log\t1.578s\tcoverage: 97.6% of statements\r\nok  \tgithub.com/copernet/copernicus/service\t12.905s\tcoverage: 81.7% of statements\r\nok  \tgithub.com/copernet/copernicus/service/mining\t13.191s\tcoverage: 85.1% of statements\r\n?   \tgithub.com/copernet/copernicus/rpc\t[no test files]\r\nok  \tgithub.com/copernet/copernicus/rpc/btcjson\t1.371s\tcoverage: 99.3% of statements\r\nok  \tgithub.com/copernet/copernicus/conf\t11.770s\tcoverage: 78.6% of statements\r\nok  \tgithub.com/copernet/copernicus/persist\t1.459s\tcoverage: 91.7% of statements\r\nok  \tgithub.com/copernet/copernicus/persist/blkdb\t1.464s\tcoverage: 78.0% of statements\r\nok  \tgithub.com/copernet/copernicus/persist/db\t12.185s\tcoverage: 84.3% of statements\r\nok  \tgithub.com/copernet/copernicus/persist/disk\t1.681s\tcoverage: 62.1% of statements\r\nok  \tgithub.com/copernet/copernicus/errcode\t1.514s\tcoverage: 82.6% of statements\r\n?   \tgithub.com/copernet/copernicus\t[no test files]\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/copernet/copernicus/issues/comments/445425106","html_url":"https://github.com/copernet/copernicus/issues/212#issuecomment-445425106","issue_url":"https://api.github.com/repos/copernet/copernicus/issues/212","id":445425106,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTQyNTEwNg==","user":{"login":"whunmr","id":1876615,"node_id":"MDQ6VXNlcjE4NzY2MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/1876615?v=4","gravatar_id":"","url":"https://api.github.com/users/whunmr","html_url":"https://github.com/whunmr","followers_url":"https://api.github.com/users/whunmr/followers","following_url":"https://api.github.com/users/whunmr/following{/other_user}","gists_url":"https://api.github.com/users/whunmr/gists{/gist_id}","starred_url":"https://api.github.com/users/whunmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whunmr/subscriptions","organizations_url":"https://api.github.com/users/whunmr/orgs","repos_url":"https://api.github.com/users/whunmr/repos","events_url":"https://api.github.com/users/whunmr/events{/privacy}","received_events_url":"https://api.github.com/users/whunmr/received_events","type":"User","site_admin":false},"created_at":"2018-12-08T03:05:00Z","updated_at":"2018-12-08T03:05:00Z","author_association":"CONTRIBUTOR","body":"fixed in https://github.com/copernet/copernicus/commit/21150af337c245af821d20502496ca45e54113aa"}}
{"actor":{"display_login":"whunmr"}}