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

services: fix logging data race after shutdown #3307

Merged
merged 6 commits into from
Feb 27, 2024

Conversation

AliceInHunterland
Copy link
Contributor

@AliceInHunterland AliceInHunterland commented Feb 8, 2024

The problem is writing to logs after the end of the test execution.
Added sync logs for every service separately to provide the ability to have a custom logger for each service.
Data race is caused by missing synchronization channels in the network server. Shutdown doesn't wait for all goroutines to finish properly.

Close #2973
Close #2974
Close #3112

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.98%. Comparing base (8ab08c6) to head (5cf0c75).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3307      +/-   ##
==========================================
+ Coverage   84.94%   84.98%   +0.04%     
==========================================
  Files         328      328              
  Lines       44754    44789      +35     
==========================================
+ Hits        38016    38066      +50     
+ Misses       5225     5214      -11     
+ Partials     1513     1509       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnnaShaleva AnnaShaleva changed the title test: fix TestServerRegisterPeer data race network: fix TestServerRegisterPeer data race Feb 8, 2024
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something has happend with the commit message indent.

pkg/network/server.go Outdated Show resolved Hide resolved
pkg/network/server_test.go Outdated Show resolved Hide resolved
pkg/network/server.go Outdated Show resolved Hide resolved
pkg/network/server.go Show resolved Hide resolved
pkg/network/server.go Outdated Show resolved Hide resolved
pkg/network/server_test.go Outdated Show resolved Hide resolved
pkg/network/server_test.go Outdated Show resolved Hide resolved
pkg/network/server_test.go Outdated Show resolved Hide resolved
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note about calls to zap log Sync: technically, all our services share the same logger instance and there's no need to call Sync manually from each service, it may be done only once from the node caller's code. However, Sync calls don't hurt us, and there's still an ability to provide custom logger to every service constructor, and thus, we'd better sync logs for every service separately.

pkg/network/server.go Outdated Show resolved Hide resolved
pkg/consensus/consensus.go Outdated Show resolved Hide resolved
pkg/network/server.go Outdated Show resolved Hide resolved
pkg/services/oracle/oracle.go Outdated Show resolved Hide resolved
pkg/consensus/consensus.go Outdated Show resolved Hide resolved
@AnnaShaleva
Copy link
Member

@AliceInHunterland, rework the second commit message and PR title/description: describe what commit actually does, i.e. proper logs flush after services shutdown. It is needed because this PR closes not only #2973, but also a set of other logs-related issues.

Search through the set of tests related issues and pick ones that will be closed by this PR. Add references to these issues to the commit message and PR description.

@AliceInHunterland
Copy link
Contributor Author

2024-02-14T09:47:23.5366050Z testing.go:1465: race detected during execution of test
FAIL: FuzzMessageDecode (0.01s)
2024-02-14T09:47:23.5417510Z FAIL
2024-02-14T09:47:23.5417830Z FAIL github.com/nspcc-dev/neo-go/pkg/network 4.299s
(#3316)
example:
https://github.com/nspcc-dev/neo-go/actions/runs/7899231937/job/21558242553?pr=3307
@AnnaShaleva, it seems like there is still a data race issue, but with the improved logging, we cannot see it...

@AliceInHunterland AliceInHunterland force-pushed the test-register-peers branch 2 times, most recently from a52c5c4 to 92174fb Compare February 14, 2024 10:02
@AliceInHunterland AliceInHunterland changed the title network: fix TestServerRegisterPeer data race services: fix logging data race after shutdown Feb 14, 2024
@AliceInHunterland AliceInHunterland force-pushed the test-register-peers branch 2 times, most recently from 72fc814 to 88140c5 Compare February 14, 2024 11:27
pkg/network/server_test.go Show resolved Hide resolved
pkg/network/server_test.go Show resolved Hide resolved
@AnnaShaleva
Copy link
Member

AnnaShaleva commented Feb 22, 2024

OK, one more problem found: Start of some services is bound to blockchain subscriptions, and thus, can't be run before the blockchain notifications dispatcher:

2024-02-21T18:46:53.9313151Z === RUN   TestQueryTx
2024-02-21T18:46:53.9315415Z     logger.go:130: 2024-02-21T18:36:53.867Z	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
2024-02-21T18:46:53.9318373Z     logger.go:130: 2024-02-21T18:36:53.867Z	INFO	P2PNotaryRequestPayloadPool size is not set or wrong, setting default value	{"P2PNotaryRequestPayloadPoolSize": 1000}
2024-02-21T18:46:53.9321292Z     logger.go:130: 2024-02-21T18:36:53.867Z	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
2024-02-21T18:46:53.9323628Z     logger.go:130: 2024-02-21T18:36:53.867Z	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
2024-02-21T18:46:53.9325196Z     logger.go:130: 2024-02-21T18:36:53.867Z	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
2024-02-21T18:46:53.9326716Z     logger.go:130: 2024-02-21T18:36:53.867Z	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 864000}
2024-02-21T18:46:53.9327999Z     logger.go:130: 2024-02-21T18:36:53.867Z	INFO	no storage version found! creating genesis block
2024-02-21T18:46:53.9328718Z coverage: 11.1% of statements in ./pkg..., ./cli/...
2024-02-21T18:46:53.9329183Z panic: test timed out after 10m0s
2024-02-21T18:46:53.9329565Z running tests:
2024-02-21T18:46:53.9329903Z 	TestQueryTx (10m0s)
2024-02-21T18:46:53.9330093Z 
2024-02-21T18:46:53.9330217Z goroutine 71 [running]:
2024-02-21T18:46:53.9330697Z testing.(*M).startAlarm.func1()
2024-02-21T18:46:53.9331315Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:2259 +0x3b9
2024-02-21T18:46:53.9331838Z created by time.goFunc
2024-02-21T18:46:53.9332325Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/time/sleep.go:176 +0x2d
2024-02-21T18:46:53.9332669Z 
2024-02-21T18:46:53.9332814Z goroutine 1 [chan receive, 10 minutes]:
2024-02-21T18:46:53.9333311Z testing.(*T).Run(0xc000007860, {0x130d7cc?, 0x581b1c?}, 0x14636d0)
2024-02-21T18:46:53.9333983Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1649 +0x3c8
2024-02-21T18:46:53.9334514Z testing.runTests.func1(0x1f27b00?)
2024-02-21T18:46:53.9335061Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:2054 +0x3e
2024-02-21T18:46:53.9335592Z testing.tRunner(0xc000007860, 0xc000221c38)
2024-02-21T18:46:53.9336142Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1595 +0xff
2024-02-21T18:46:53.9336875Z testing.runTests(0xc0003b45a0?, {0x1f02780, 0x2, 0x2}, {0x4170ff?, 0xc000221cf8?, 0x1f26960?})
2024-02-21T18:46:53.9337630Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:2052 +0x445
2024-02-21T18:46:53.9338145Z testing.(*M).Run(0xc0003b45a0)
2024-02-21T18:46:53.9338651Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1925 +0x636
2024-02-21T18:46:53.9339141Z main.main()
2024-02-21T18:46:53.9339444Z 	_testmain.go:85 +0x1bf
2024-02-21T18:46:53.9339652Z 
2024-02-21T18:46:53.9339788Z goroutine 129 [chan send, 10 minutes]:
2024-02-21T18:46:53.9340619Z github.com/nspcc-dev/neo-go/pkg/core.(*Blockchain).SubscribeForBlocks(0xc0004d0580?, 0xeb1daece2d0db4c4?)
2024-02-21T18:46:53.9341677Z 	/home/runner/work/neo-go/neo-go/pkg/core/blockchain.go:2290 +0x6b
2024-02-21T18:46:53.9342405Z github.com/nspcc-dev/neo-go/pkg/consensus.(*service).Start(0xc0003b7760?)
2024-02-21T18:46:53.9343206Z 	/home/runner/work/neo-go/neo-go/pkg/consensus/consensus.go:284 +0x134
2024-02-21T18:46:53.9343996Z github.com/nspcc-dev/neo-go/pkg/network.(*Server).tryStartServices(0xc000457000)
2024-02-21T18:46:53.9344777Z 	/home/runner/work/neo-go/neo-go/pkg/network/server.go:578 +0x20c
2024-02-21T18:46:53.9345480Z github.com/nspcc-dev/neo-go/pkg/network.(*Server).Start(0xc000457000?)
2024-02-21T18:46:53.9346200Z 	/home/runner/work/neo-go/neo-go/pkg/network/server.go:286 +0x24f
2024-02-21T18:46:53.9346958Z github.com/nspcc-dev/neo-go/internal/testcli.NewTestChain(0xc000007a00?, 0x0, 0x0)
2024-02-21T18:46:53.9347789Z 	/home/runner/work/neo-go/neo-go/internal/testcli/executor.go:167 +0xc72
2024-02-21T18:46:53.9348709Z github.com/nspcc-dev/neo-go/internal/testcli.NewExecutorWithConfig(0xc000007a00, 0x1, 0x2b?, 0x58216d?)
2024-02-21T18:46:53.9349639Z 	/home/runner/work/neo-go/neo-go/internal/testcli/executor.go:193 +0x19c
2024-02-21T18:46:53.9350380Z github.com/nspcc-dev/neo-go/internal/testcli.NewExecutorSuspended(...)
2024-02-21T18:46:53.9351109Z 	/home/runner/work/neo-go/neo-go/internal/testcli/executor.go:180
2024-02-21T18:46:53.9351881Z github.com/nspcc-dev/neo-go/cli/query_test.TestQueryTx(0x0?)
2024-02-21T18:46:53.9352561Z 	/home/runner/work/neo-go/neo-go/cli/query/query_test.go:26 +0x31
2024-02-21T18:46:53.9353086Z testing.tRunner(0xc000007a00, 0x14636d0)
2024-02-21T18:46:53.9353659Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1595 +0xff
2024-02-21T18:46:53.9354213Z created by testing.(*T).Run in goroutine 1
2024-02-21T18:46:53.9354788Z 	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1648 +0x3ad
2024-02-21T18:46:53.9355212Z 
2024-02-21T18:46:53.9355348Z goroutine 133 [select, 10 minutes]:
2024-02-21T18:46:53.9356098Z github.com/nspcc-dev/neo-go/pkg/core/mempool.(*Pool).notificationDispatcher(0xc0003b7760)
2024-02-21T18:46:53.9357016Z 	/home/runner/work/neo-go/neo-go/pkg/core/mempool/subscriptions.go:55 +0x1b9
2024-02-21T18:46:53.9357931Z created by github.com/nspcc-dev/neo-go/pkg/core/mempool.(*Pool).RunSubscriptions in goroutine 129
2024-02-21T18:46:53.9358845Z 	/home/runner/work/neo-go/neo-go/pkg/core/mempool/subscriptions.go:13 +0xcd
2024-02-21T18:46:53.9359497Z FAIL	github.com/nspcc-dev/neo-go/cli/query	600.098s
2024-02-21T18:46:53.9359943Z === RUN   TestGetPath

What we need is: in a separate commit move blockchain/mempool subscriptions of all dependent services from Start to run routine:

s.chain.SubscribeForBlocks(s.blockCh)
go s.run()

pkg/network/server.go Outdated Show resolved Hide resolved
pkg/network/server.go Outdated Show resolved Hide resolved
@AnnaShaleva
Copy link
Member

Some problems with tests, do they connected with the latest network server Start refactoring?

2024-02-22T14:23:40.8217958Z === RUN   TestUtilCancelTx
2024-02-22T14:23:40.8219714Z     logger.go:130: 2024-02-22T14:23:34.440Z	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
2024-02-22T14:23:40.8222705Z     logger.go:130: 2024-02-22T14:23:34.440Z	INFO	P2PNotaryRequestPayloadPool size is not set or wrong, setting default value	{"P2PNotaryRequestPayloadPoolSize": 1000}
2024-02-22T14:23:40.8509342Z     logger.go:130: 2024-02-22T14:23:34.440Z	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
2024-02-22T14:23:40.8512256Z     logger.go:130: 2024-02-22T14:23:34.440Z	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
2024-02-22T14:23:40.8514866Z     logger.go:130: 2024-02-22T14:23:34.440Z	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
2024-02-22T14:23:40.8517548Z     logger.go:130: 2024-02-22T14:23:34.440Z	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 864000}
2024-02-22T14:23:40.8519773Z     logger.go:130: 2024-02-22T14:23:34.440Z	INFO	no storage version found! creating genesis block
2024-02-22T14:23:40.8522019Z     logger.go:130: 2024-02-22T14:23:34.451Z	INFO	MaxIteratorResultItems is not set or wrong, setting default value	{"MaxIteratorResultItems": 100}
2024-02-22T14:23:40.8525458Z     logger.go:130: 2024-02-22T14:23:34.451Z	INFO	MaxFindResultItems is not set or wrong, setting default value	{"MaxFindResultItems": 100}
2024-02-22T14:23:40.8528186Z     logger.go:130: 2024-02-22T14:23:34.451Z	INFO	MaxFindStorageResultItems is not set or wrong, setting default value	{"MaxFindStorageResultItems": 50}
2024-02-22T14:23:40.8530742Z     logger.go:130: 2024-02-22T14:23:34.451Z	INFO	MaxNEP11Tokens is not set or wrong, setting default value	{"MaxNEP11Tokens": 100}
2024-02-22T14:23:40.8533270Z     logger.go:130: 2024-02-22T14:23:34.451Z	INFO	MaxRequestBodyBytes is not set or wong, setting default value	{"MaxRequestBodyBytes": 5242880}
2024-02-22T14:23:40.8535875Z     logger.go:130: 2024-02-22T14:23:34.451Z	INFO	MaxRequestHeaderBytes is not set or wong, setting default value	{"MaxRequestHeaderBytes": 1048576}
2024-02-22T14:23:40.8725021Z     logger.go:130: 2024-02-22T14:23:34.451Z	INFO	MaxWebSocketClients is not set or wrong, setting default value	{"MaxWebSocketClients": 64}
2024-02-22T14:23:40.8727360Z     logger.go:130: 2024-02-22T14:23:34.451Z	INFO	starting rpc-server	{"endpoint": "127.0.0.1:0"}
2024-02-22T14:23:40.8729832Z     logger.go:130: 2024-02-22T14:23:34.451Z	DEBUG	done processing headers	{"headerIndex": 1, "blockHeight": 0, "took": "206.806µs"}
2024-02-22T14:23:40.8731998Z     logger.go:130: 2024-02-22T14:23:34.452Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.8734077Z     logger.go:130: 2024-02-22T14:23:34.453Z	DEBUG	processing rpc request	{"method": "getnativecontracts", "params": "[]"}
2024-02-22T14:23:40.8736124Z     logger.go:130: 2024-02-22T14:23:34.454Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.8738615Z     logger.go:130: 2024-02-22T14:23:34.455Z	DEBUG	processing rpc request	{"method": "getnep17balances", "params": "[56c989e76f9a2ca05bb5caa6c96f524d905accd8]"}
2024-02-22T14:23:40.8800530Z     logger.go:130: 2024-02-22T14:23:34.455Z	DEBUG	processing rpc request	{"method": "invokescript", "params": "[CxEMFNwk6EPkEi4hj1BzCuuZPYVDDVeBDBTYzFqQTVJvyabKtVugLJpv54nJVhTAHwwIdHJhbnNmZXIMFPVj6kC8KD1NDgXEjqMFs/Kgc0DvQWJ9W1I5 ]"}
2024-02-22T14:23:40.8803791Z     logger.go:130: 2024-02-22T14:23:34.455Z	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
2024-02-22T14:23:40.8809582Z     logger.go:130: 2024-02-22T14:23:34.456Z	DEBUG	processing rpc request	{"method": "calculatenetworkfee", "params": "[AHWHniC0P5gAAAAAAAAAAAAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAVwsRDBTcJOhD5BIuIY9QcwrrmT2FQw1XgQwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQEAKhEMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwhFBntDcOg==]"}
2024-02-22T14:23:40.8819198Z     logger.go:130: 2024-02-22T14:23:34.456Z	DEBUG	processing rpc request	{"method": "sendrawtransaction", "params": "[AHWHniC0P5gAAAAAAPTGEgAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAVwsRDBTcJOhD5BIuIY9QcwrrmT2FQw1XgQwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQFCDEBOUDWVRG4VN/OCUHe4YFD/6pJwlERO5OgYJvWWYi99iyTD/wA5pqwpBcZVIzYgF+6NMW6uz5n0gkvhqAs0oYsGKhEMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwhFBntDcOg==]"}
2024-02-22T14:23:40.8824303Z === RUN   TestUtilCancelTx/invalid
2024-02-22T14:23:40.8825373Z === RUN   TestUtilCancelTx/invalid/missing_tx_argument
2024-02-22T14:23:40.8826038Z transaction hash is missing
2024-02-22T14:23:40.8826647Z === RUN   TestUtilCancelTx/invalid/excessive_arguments
2024-02-22T14:23:40.8827337Z only one transaction hash is accepted
2024-02-22T14:23:40.8827994Z === RUN   TestUtilCancelTx/invalid/invalid_hash
2024-02-22T14:23:40.8828629Z invalid tx hash: notahash
2024-02-22T14:23:40.8829282Z === RUN   TestUtilCancelTx/invalid/not_signed_by_main_signer
2024-02-22T14:23:40.8830021Z === NAME  TestUtilCancelTx
2024-02-22T14:23:40.8831517Z     logger.go:130: 2024-02-22T14:23:34.459Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.8833642Z     logger.go:130: 2024-02-22T14:23:34.459Z	DEBUG	processing rpc request	{"method": "getnativecontracts", "params": "[]"}
2024-02-22T14:23:40.8836128Z     logger.go:130: 2024-02-22T14:23:34.461Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.8838941Z     logger.go:130: 2024-02-22T14:23:34.461Z	DEBUG	processing rpc request	{"method": "getrawtransaction", "params": "[e693aab6ceb7c664e610c5e4720a78e80be95a5fc75e5f10891c3357d91e4257 1]"}
2024-02-22T14:23:40.8841234Z account NVTiAjNgagDkTr5HTzDmQP9kPwPHN5BgVq is not a signer of the conflicting transaction
2024-02-22T14:23:40.8842280Z === RUN   TestUtilCancelTx/invalid/wrong_rpc_endpoint
2024-02-22T14:23:40.8843563Z failed to get network magic: Post "http://localhost:20331": dial tcp [::1]:20331: connect: connection refused
2024-02-22T14:23:40.8844689Z === NAME  TestUtilCancelTx
2024-02-22T14:23:40.8846141Z     logger.go:130: 2024-02-22T14:23:34.463Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.8848219Z     logger.go:130: 2024-02-22T14:23:34.463Z	DEBUG	processing rpc request	{"method": "getnativecontracts", "params": "[]"}
2024-02-22T14:23:40.8850485Z     logger.go:130: 2024-02-22T14:23:34.476Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.8853195Z     logger.go:130: 2024-02-22T14:23:34.476Z	DEBUG	processing rpc request	{"method": "getrawtransaction", "params": "[e693aab6ceb7c664e610c5e4720a78e80be95a5fc75e5f10891c3357d91e4257 1]"}
2024-02-22T14:23:40.8855753Z     logger.go:130: 2024-02-22T14:23:34.476Z	DEBUG	processing rpc request	{"method": "invokescript", "params": "[QA== ]"}
2024-02-22T14:23:40.8857791Z     logger.go:130: 2024-02-22T14:23:34.477Z	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
2024-02-22T14:23:40.8862394Z     logger.go:130: 2024-02-22T14:23:34.478Z	DEBUG	processing rpc request	{"method": "calculatenetworkfee", "params": "[ANplYRkAAAAAAAAAAAAAAAAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEBIVdCHtlXMxyJEF9ex19a6QvoeApy5MUQ5mTGt862qpPmAUABACoRDCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcIRQZ7Q3Do=]"}
2024-02-22T14:23:40.8869674Z     logger.go:130: 2024-02-22T14:23:34.478Z	DEBUG	processing rpc request	{"method": "sendrawtransaction", "params": "[ANplYRkAAAAAAAAAAPXGEgAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEBIVdCHtlXMxyJEF9ex19a6QvoeApy5MUQ5mTGt862qpPmAUABQgxARzxnK+d/VfPWmCrNF7blHX60BmBQSOJ8o9lNUxsDje/FN9hJs1UqKmhhn9P3rjvZr9amB8PBd8yke9Fv2aAMbyoRDCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcIRQZ7Q3Do=]"}
2024-02-22T14:23:40.8874697Z     logger.go:130: 2024-02-22T14:23:35.479Z	INFO	persisted to disk	{"blocks": 1, "keys": 139, "headerHeight": 1, "blockHeight": 1, "took": "82.424µs"}
2024-02-22T14:23:40.8876044Z     util_test.go:134: 
2024-02-22T14:23:40.8877213Z         	Error Trace:	/home/runner/work/neo-go/neo-go/cli/util/util_test.go:134
2024-02-22T14:23:40.8878260Z         	Error:      	Condition never satisfied
2024-02-22T14:23:40.8879020Z         	Test:       	TestUtilCancelTx
2024-02-22T14:23:40.8880438Z     logger.go:130: 2024-02-22T14:23:36.482Z	INFO	shutting down RPC server	{"endpoint": "127.0.0.1:38795"}
2024-02-22T14:23:40.8881604Z --- FAIL: TestUtilCancelTx (2.04s)
2024-02-22T14:23:40.8882428Z     --- PASS: TestUtilCancelTx/invalid (0.01s)
2024-02-22T14:23:40.8883544Z         --- PASS: TestUtilCancelTx/invalid/missing_tx_argument (0.00s)
2024-02-22T14:23:40.8884800Z         --- PASS: TestUtilCancelTx/invalid/excessive_arguments (0.00s)
2024-02-22T14:23:40.8885999Z         --- PASS: TestUtilCancelTx/invalid/invalid_hash (0.00s)
2024-02-22T14:23:40.8887279Z         --- PASS: TestUtilCancelTx/invalid/not_signed_by_main_signer (0.00s)
2024-02-22T14:23:40.8888583Z         --- PASS: TestUtilCancelTx/invalid/wrong_rpc_endpoint (0.00s)
2024-02-22T14:23:40.8889371Z === RUN   TestAwaitUtilCancelTx
2024-02-22T14:23:40.8891115Z     logger.go:130: 2024-02-22T14:23:36.483Z	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
2024-02-22T14:23:40.8894129Z     logger.go:130: 2024-02-22T14:23:36.483Z	INFO	P2PNotaryRequestPayloadPool size is not set or wrong, setting default value	{"P2PNotaryRequestPayloadPoolSize": 1000}
2024-02-22T14:23:40.8896776Z     logger.go:130: 2024-02-22T14:23:36.483Z	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
2024-02-22T14:23:40.8899224Z     logger.go:130: 2024-02-22T14:23:36.483Z	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
2024-02-22T14:23:40.8902076Z     logger.go:130: 2024-02-22T14:23:36.483Z	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
2024-02-22T14:23:40.8904867Z     logger.go:130: 2024-02-22T14:23:36.483Z	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 864000}
2024-02-22T14:23:40.8907125Z     logger.go:130: 2024-02-22T14:23:36.483Z	INFO	no storage version found! creating genesis block
2024-02-22T14:23:40.8909324Z     logger.go:130: 2024-02-22T14:23:36.486Z	INFO	MaxIteratorResultItems is not set or wrong, setting default value	{"MaxIteratorResultItems": 100}
2024-02-22T14:23:40.8911848Z     logger.go:130: 2024-02-22T14:23:36.486Z	INFO	MaxFindResultItems is not set or wrong, setting default value	{"MaxFindResultItems": 100}
2024-02-22T14:23:40.8914756Z     logger.go:130: 2024-02-22T14:23:36.486Z	INFO	MaxFindStorageResultItems is not set or wrong, setting default value	{"MaxFindStorageResultItems": 50}
2024-02-22T14:23:40.8917285Z     logger.go:130: 2024-02-22T14:23:36.486Z	INFO	MaxNEP11Tokens is not set or wrong, setting default value	{"MaxNEP11Tokens": 100}
2024-02-22T14:23:40.8919730Z     logger.go:130: 2024-02-22T14:23:36.486Z	INFO	MaxRequestBodyBytes is not set or wong, setting default value	{"MaxRequestBodyBytes": 5242880}
2024-02-22T14:23:40.8922310Z     logger.go:130: 2024-02-22T14:23:36.486Z	INFO	MaxRequestHeaderBytes is not set or wong, setting default value	{"MaxRequestHeaderBytes": 1048576}
2024-02-22T14:23:40.8924834Z     logger.go:130: 2024-02-22T14:23:36.486Z	INFO	MaxWebSocketClients is not set or wrong, setting default value	{"MaxWebSocketClients": 64}
2024-02-22T14:23:40.9174848Z     logger.go:130: 2024-02-22T14:23:36.486Z	INFO	starting rpc-server	{"endpoint": "127.0.0.1:0"}
2024-02-22T14:23:40.9176941Z     logger.go:130: 2024-02-22T14:23:36.487Z	DEBUG	done processing headers	{"headerIndex": 1, "blockHeight": 0, "took": "194.122µs"}
2024-02-22T14:23:40.9178985Z     logger.go:130: 2024-02-22T14:23:36.488Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.9180981Z     logger.go:130: 2024-02-22T14:23:36.488Z	DEBUG	processing rpc request	{"method": "getnativecontracts", "params": "[]"}
2024-02-22T14:23:40.9183059Z     logger.go:130: 2024-02-22T14:23:36.498Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.9185410Z     logger.go:130: 2024-02-22T14:23:36.498Z	DEBUG	processing rpc request	{"method": "getnep17balances", "params": "[56c989e76f9a2ca05bb5caa6c96f524d905accd8]"}
2024-02-22T14:23:40.9189049Z     logger.go:130: 2024-02-22T14:23:36.498Z	DEBUG	processing rpc request	{"method": "invokescript", "params": "[CxEMFNwk6EPkEi4hj1BzCuuZPYVDDVeBDBTYzFqQTVJvyabKtVugLJpv54nJVhTAHwwIdHJhbnNmZXIMFPVj6kC8KD1NDgXEjqMFs/Kgc0DvQWJ9W1I5 ]"}
2024-02-22T14:23:40.9192114Z     logger.go:130: 2024-02-22T14:23:36.499Z	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
2024-02-22T14:23:40.9197694Z     logger.go:130: 2024-02-22T14:23:36.499Z	DEBUG	processing rpc request	{"method": "calculatenetworkfee", "params": "[AEjxT/q0P5gAAAAAAAAAAAAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAVwsRDBTcJOhD5BIuIY9QcwrrmT2FQw1XgQwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQEAKhEMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwhFBntDcOg==]"}
2024-02-22T14:23:40.9207653Z     logger.go:130: 2024-02-22T14:23:36.499Z	DEBUG	processing rpc request	{"method": "sendrawtransaction", "params": "[AEjxT/q0P5gAAAAAAPTGEgAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAVwsRDBTcJOhD5BIuIY9QcwrrmT2FQw1XgQwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQFCDEBhOLKqu564xqgTCp3K02gVHnE13YJhzGJZZPpvwvhk/UHv0gN1BAsU6U1aDq5FZCQLbB4cnBTfl5955wHlEsfbKhEMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwhFBntDcOg==]"}
2024-02-22T14:23:40.9213434Z     logger.go:130: 2024-02-22T14:23:36.500Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.9215398Z     logger.go:130: 2024-02-22T14:23:36.500Z	DEBUG	processing rpc request	{"method": "getnativecontracts", "params": "[]"}
2024-02-22T14:23:40.9217334Z     logger.go:130: 2024-02-22T14:23:36.502Z	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
2024-02-22T14:23:40.9219905Z     logger.go:130: 2024-02-22T14:23:36.502Z	DEBUG	processing rpc request	{"method": "getrawtransaction", "params": "[399cf2728ee7c55cd0a9c329ecbe9c2606f9025762288936b25037ca8c8090ee 1]"}
2024-02-22T14:23:40.9303310Z     logger.go:130: 2024-02-22T14:23:36.502Z	DEBUG	processing rpc request	{"method": "invokescript", "params": "[QA== ]"}
2024-02-22T14:23:40.9306091Z     logger.go:130: 2024-02-22T14:23:36.503Z	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
2024-02-22T14:23:40.9311205Z     logger.go:130: 2024-02-22T14:23:36.503Z	DEBUG	processing rpc request	{"method": "calculatenetworkfee", "params": "[ACIYuXcAAAAAAAAAAAAAAAAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEBIe6QgIzKN1CyNokoYlcC+QYmnL7sKcOp0FzF545y8pw5AUABACoRDCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcIRQZ7Q3Do=]"}
2024-02-22T14:23:40.9318610Z     logger.go:130: 2024-02-22T14:23:36.503Z	DEBUG	processing rpc request	{"method": "sendrawtransaction", "params": "[ACIYuXcAAAAAAAAAAPXGEgAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEBIe6QgIzKN1CyNokoYlcC+QYmnL7sKcOp0FzF545y8pw5AUABQgxAQoIXnHU4CE27b0d/iJb9D7VNuTUOU/3tMijCObXY9keVB2g7NQm1SA29fuS/oTVlPF3lM/iza5bZUrGp425R9SoRDCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcIRQZ7Q3Do=]"}
2024-02-22T14:23:40.9323304Z     logger.go:130: 2024-02-22T14:23:36.554Z	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
2024-02-22T14:23:40.9326236Z     logger.go:130: 2024-02-22T14:23:36.554Z	DEBUG	processing rpc request	{"method": "getapplicationlog", "params": "[399cf2728ee7c55cd0a9c329ecbe9c2606f9025762288936b25037ca8c8090ee Application]"}
2024-02-22T14:23:40.9330366Z     logger.go:130: 2024-02-22T14:23:36.554Z	INFO	Error encountered with rpc request	{"code": -105, "cause": "failed to locate application log: key not found", "method": "getapplicationlog", "params": "[399cf2728ee7c55cd0a9c329ecbe9c2606f9025762288936b25037ca8c8090ee Application]"}
2024-02-22T14:23:40.9502908Z     logger.go:130: 2024-02-22T14:23:36.554Z	DEBUG	processing rpc request	{"method": "getapplicationlog", "params": "[bd4915817316fd13825b9caa898dd42c01df620584299e737583938450eabf71 Application]"}
2024-02-22T14:23:40.9507201Z     logger.go:130: 2024-02-22T14:23:36.554Z	INFO	Error encountered with rpc request	{"code": -105, "cause": "failed to locate application log: key not found", "method": "getapplicationlog", "params": "[bd4915817316fd13825b9caa898dd42c01df620584299e737583938450eabf71 Application]"}
2024-02-22T14:23:40.9510483Z     logger.go:130: 2024-02-22T14:23:36.587Z	DEBUG	done processing headers	{"headerIndex": 2, "blockHeight": 1, "took": "150.801µs"}
2024-02-22T14:23:40.9512546Z     logger.go:130: 2024-02-22T14:23:36.604Z	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
2024-02-22T14:23:40.9515296Z     logger.go:130: 2024-02-22T14:23:36.604Z	DEBUG	processing rpc request	{"method": "getapplicationlog", "params": "[399cf2728ee7c55cd0a9c329ecbe9c2606f9025762288936b25037ca8c8090ee Application]"}
2024-02-22T14:23:40.9519229Z     logger.go:130: 2024-02-22T14:23:36.604Z	INFO	Error encountered with rpc request	{"code": -105, "cause": "failed to locate application log: EOF", "method": "getapplicationlog", "params": "[399cf2728ee7c55cd0a9c329ecbe9c2606f9025762288936b25037ca8c8090ee Application]"}
2024-02-22T14:23:40.9523205Z     logger.go:130: 2024-02-22T14:23:36.604Z	DEBUG	processing rpc request	{"method": "getapplicationlog", "params": "[bd4915817316fd13825b9caa898dd42c01df620584299e737583938450eabf71 Application]"}
2024-02-22T14:23:40.9525836Z     logger.go:130: 2024-02-22T14:23:36.689Z	DEBUG	done processing headers	{"headerIndex": 3, "blockHeight": 2, "took": "105.917µs"}
2024-02-22T14:23:40.9527752Z     logger.go:130: 2024-02-22T14:23:36.756Z	INFO	shutting down RPC server	{"endpoint": "127.0.0.1:36987"}
2024-02-22T14:23:40.9529885Z     logger.go:130: 2024-02-22T14:23:36.756Z	INFO	persisted to disk	{"blocks": 3, "keys": 168, "headerHeight": 3, "blockHeight": 3, "took": "67.496µs"}
2024-02-22T14:23:40.9531260Z --- PASS: TestAwaitUtilCancelTx (0.27s)
2024-02-22T14:23:40.9531788Z FAIL
2024-02-22T14:23:40.9532239Z coverage: 21.6% of statements in ./pkg..., ./cli/...
2024-02-22T14:23:40.9533057Z FAIL	github.com/nspcc-dev/neo-go/cli/util	2.422s
2024-02-22T14:27:56.0005885Z     logger.go:130: 2024-02-22T14:23:40.814Z	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
2024-02-22T14:27:56.0013202Z     logger.go:130: 2024-02-22T14:23:40.815Z	DEBUG	processing rpc request	{"method": "calculatenetworkfee", "params": "[AEIEy5pofzABAAAAAAAAAAAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAtgsaDBTunqIsJ+NL0BSPxBCOCPdOj1BIsgwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQsDABCl1OgAAAAMFO6eoiwn40vQFI/EEI4I906PUEiyDBTYzFqQTVJvyabKtVugLJpv54nJVhTAHwwIdHJhbnNmZXIMFM924ovQBixKR47jVWEBExnzz6TSQWJ9W1I5AQAqEQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6]"}
2024-02-22T14:27:56.0026207Z     logger.go:130: 2024-02-22T14:23:40.816Z	DEBUG	processing rpc request	{"method": "sendrawtransaction", "params": "[AEIEy5pofzABAAAAAAw6FAAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAtgsaDBTunqIsJ+NL0BSPxBCOCPdOj1BIsgwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQsDABCl1OgAAAAMFO6eoiwn40vQFI/EEI4I906PUEiyDBTYzFqQTVJvyabKtVugLJpv54nJVhTAHwwIdHJhbnNmZXIMFM924ovQBixKR47jVWEBExnzz6TSQWJ9W1I5AUIMQOL5fPdFzeZQmQf0lK+RPvnMHSo819FE9yJ4AxN3F4bYyJMdl8Chx+1R9X9ei0ScAwmGddA/E98saatWIt9QNoIqEQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6]"}
2024-02-22T14:27:56.0034080Z     logger.go:130: 2024-02-22T14:23:41.787Z	INFO	persisted to disk	{"blocks": 1, "keys": 139, "headerHeight": 1, "blockHeight": 1, "took": "139.342µs"}
2024-02-22T14:27:56.0035687Z     executor.go:220: 
2024-02-22T14:27:56.0037060Z         	Error Trace:	/home/runner/work/neo-go/neo-go/internal/testcli/executor.go:220
2024-02-22T14:27:56.0041145Z         	            				/home/runner/work/neo-go/neo-go/internal/testcli/executor.go:304
2024-02-22T14:27:56.0043164Z         	            				/home/runner/work/neo-go/neo-go/cli/wallet/candidate_test.go:31
2024-02-22T14:27:56.0044308Z         	Error:      	Condition never satisfied
2024-02-22T14:27:56.0045188Z         	Test:       	TestRegisterCandidate
2024-02-22T14:27:56.0046150Z         	Messages:   	too long time waiting for block
2024-02-22T14:27:56.0047743Z     logger.go:130: 2024-02-22T14:23:42.818Z	INFO	shutting down RPC server	{"endpoint": "127.0.0.1:38519"}
2024-02-22T14:27:56.0048992Z --- FAIL: TestRegisterCandidate (2.04s)

@AnnaShaleva
Copy link
Member

OK, not merging it for now, I need to carefully review the updated code, something is wrong.

@AliceInHunterland
Copy link
Contributor Author

also sometimes :

    query_test.go:59: 
        	Error Trace:	/Users/ekaterinapavlova/Workplace/neo-go/cli/query/query_test.go:59
        	Error:      	Condition never satisfied
        	Test:       	TestQueryTx
    logger.go:130: 2024-02-22T18:17:53.566+0300	INFO	shutting down RPC server	{"endpoint": "127.0.0.1:51947"}
--- FAIL: TestQueryTx (3.01s)

FAIL

getting key not found

@AnnaShaleva
Copy link
Member

OK, here's the problem, and it's in the second commit: there's a race between consensus service blocks subscription and first block announcement.

Successful test run assume that consensus service is subscribed firstly, and only after that the first block is being announced by Blockchain. In this case consensus service is able to properly update dBFT state and move to the next height:

GOROOT=/usr/local/go #gosetup
GOPATH=/home/anna/go #gosetup
/usr/local/go/bin/go test -c -o /home/anna/.cache/JetBrains/GoLand2023.3/tmp/GoLand/___TestQueryTx_in_github_com_nspcc_dev_neo_go_cli_query.test github.com/nspcc-dev/neo-go/cli/query #gosetup
/usr/local/go/bin/go tool test2json -t /home/anna/.cache/JetBrains/GoLand2023.3/tmp/GoLand/___TestQueryTx_in_github_com_nspcc_dev_neo_go_cli_query.test -test.v -test.paniconexit0 -test.run ^\QTestQueryTx\E$
=== RUN   TestQueryTx
    logger.go:130: 2024-02-27T14:02:59.115+0300	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
    logger.go:130: 2024-02-27T14:02:59.115+0300	INFO	P2PNotaryRequestPayloadPool size is not set or wrong, setting default value	{"P2PNotaryRequestPayloadPoolSize": 1000}
    logger.go:130: 2024-02-27T14:02:59.115+0300	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
    logger.go:130: 2024-02-27T14:02:59.115+0300	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
    logger.go:130: 2024-02-27T14:02:59.115+0300	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
    logger.go:130: 2024-02-27T14:02:59.115+0300	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 864000}
    logger.go:130: 2024-02-27T14:02:59.115+0300	INFO	no storage version found! creating genesis block
2024-02-27T14:02:59.117+0300	INFO	consensus/consensus.go:281	starting consensus service
2024-02-27T14:02:59.117+0300	INFO	[email protected]/dbft.go:107	initializing dbft	{"height": 1, "view": 0, "index": 0, "role": "Primary"}
2024-02-27T14:02:59.117+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 1, "v": 0, "delay": "0s"}
2024-02-27T14:02:59.117+0300	DEBUG	[email protected]/send.go:9	broadcasting message	{"type": "PrepareRequest", "height": 1, "view": 0}
2024-02-27T14:02:59.118+0300	INFO	[email protected]/send.go:40	sending PrepareRequest	{"height": 1, "view": 0}
2024-02-27T14:02:59.118+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 1, "v": 0, "delay": "100ms"}
2024-02-27T14:02:59.118+0300	DEBUG	[email protected]/check.go:29	check preparations	{"hasReq": true, "count": 1, "M": 1}
2024-02-27T14:02:59.118+0300	INFO	[email protected]/send.go:134	sending Commit	{"height": 1, "view": 0}
2024-02-27T14:02:59.118+0300	DEBUG	[email protected]/send.go:9	broadcasting message	{"type": "Commit", "height": 1, "view": 0}
2024-02-27T14:02:59.118+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 1, "v": 0, "delay": "100ms"}
2024-02-27T14:02:59.118+0300	INFO	[email protected]/check.go:66	approving block	{"height": 1, "hash": "55dfd8f2884f5f17abd9f2d7d1d6ffa7b0e3df419de8eec9a6d8cfd135ee0af2", "tx_count": 0, "merkle": "0000000000000000000000000000000000000000000000000000000000000000", "prev": "fe78c256de052957c4b40d2dceae1deb9074fafaaa4f5f600e64230e60015b62"}
    logger.go:130: 2024-02-27T14:02:59.118+0300	INFO	MaxIteratorResultItems is not set or wrong, setting default value	{"MaxIteratorResultItems": 100}
    logger.go:130: 2024-02-27T14:02:59.118+0300	INFO	MaxFindResultItems is not set or wrong, setting default value	{"MaxFindResultItems": 100}
    logger.go:130: 2024-02-27T14:02:59.118+0300	INFO	MaxFindStorageResultItems is not set or wrong, setting default value	{"MaxFindStorageResultItems": 50}
    logger.go:130: 2024-02-27T14:02:59.118+0300	INFO	MaxNEP11Tokens is not set or wrong, setting default value	{"MaxNEP11Tokens": 100}
    logger.go:130: 2024-02-27T14:02:59.118+0300	INFO	MaxRequestBodyBytes is not set or wong, setting default value	{"MaxRequestBodyBytes": 5242880}
    logger.go:130: 2024-02-27T14:02:59.118+0300	INFO	MaxRequestHeaderBytes is not set or wong, setting default value	{"MaxRequestHeaderBytes": 1048576}
    logger.go:130: 2024-02-27T14:02:59.118+0300	INFO	MaxWebSocketClients is not set or wrong, setting default value	{"MaxWebSocketClients": 64}
    logger.go:130: 2024-02-27T14:02:59.118+0300	INFO	starting rpc-server	{"endpoint": "127.0.0.1:0"}
    logger.go:130: 2024-02-27T14:02:59.118+0300	DEBUG	done processing headers	{"headerIndex": 1, "blockHeight": 0, "took": "186.287µs"}
    logger.go:130: 2024-02-27T14:02:59.119+0300	INFO	sending block event	{"index": 1}
    logger.go:130: 2024-02-27T14:02:59.119+0300	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
    logger.go:130: 2024-02-27T14:02:59.120+0300	DEBUG	processing rpc request	{"method": "getnativecontracts", "params": "[]"}
    logger.go:130: 2024-02-27T14:02:59.121+0300	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
    logger.go:130: 2024-02-27T14:02:59.121+0300	DEBUG	processing rpc request	{"method": "getnep17balances", "params": "[56c989e76f9a2ca05bb5caa6c96f524d905accd8]"}
    logger.go:130: 2024-02-27T14:02:59.122+0300	DEBUG	processing rpc request	{"method": "invokescript", "params": "[CxEMFNwk6EPkEi4hj1BzCuuZPYVDDVeBDBTYzFqQTVJvyabKtVugLJpv54nJVhTAHwwIdHJhbnNmZXIMFPVj6kC8KD1NDgXEjqMFs/Kgc0DvQWJ9W1I5 ]"}
    logger.go:130: 2024-02-27T14:02:59.122+0300	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
    logger.go:130: 2024-02-27T14:02:59.122+0300	DEBUG	processing rpc request	{"method": "calculatenetworkfee", "params": "[AKeXA5G0P5gAAAAAAAAAAAAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAVwsRDBTcJOhD5BIuIY9QcwrrmT2FQw1XgQwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQEAKhEMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwhFBntDcOg==]"}
    logger.go:130: 2024-02-27T14:02:59.123+0300	DEBUG	processing rpc request	{"method": "sendrawtransaction", "params": "[AKeXA5G0P5gAAAAAAPTGEgAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAVwsRDBTcJOhD5BIuIY9QcwrrmT2FQw1XgQwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQFCDEBYRzEu8edktFHtRk4AEoIR0gVKye0vXSMDOjzthj6LWB2A/C4iBNLqblO+MzDJt/ZDLX/GIHHl9YigHDI9K8NPKhEMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwhFBntDcOg==]"}
    logger.go:130: 2024-02-27T14:02:59.123+0300	INFO	running blockchain
    logger.go:130: 2024-02-27T14:02:59.123+0300	INFO	running notification dispatcher
    logger.go:130: 2024-02-27T14:02:59.123+0300	INFO	ntf dispatcher: subscribe blocks
    logger.go:130: 2024-02-27T14:02:59.123+0300	INFO	ntf dispatcher: event	{"index": 1, "len(blockFeed)": 1}
    logger.go:130: 2024-02-27T14:02:59.123+0300	INFO	ntf dispatcher: subscribe blocks
2024-02-27T14:02:59.123+0300	DEBUG	consensus/consensus.go:382	new block in the chain	{"dbft index": 1, "chain index": 1}
2024-02-27T14:02:59.123+0300	INFO	[email protected]/dbft.go:107	initializing dbft	{"height": 2, "view": 0, "index": 0, "role": "Primary"}
    logger.go:130: 2024-02-27T14:02:59.123+0300	INFO	sent block event	{"index": 1}
2024-02-27T14:02:59.123+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 2, "v": 0, "delay": "95.182902ms"}
2024-02-27T14:02:59.219+0300	DEBUG	consensus/consensus.go:313	timer fired	{"height": 2, "view": 0}
2024-02-27T14:02:59.219+0300	DEBUG	[email protected]/dbft.go:185	timeout	{"height": 2, "view": 0}
2024-02-27T14:02:59.219+0300	DEBUG	[email protected]/send.go:9	broadcasting message	{"type": "PrepareRequest", "height": 2, "view": 0}
2024-02-27T14:02:59.220+0300	INFO	[email protected]/send.go:40	sending PrepareRequest	{"height": 2, "view": 0}
2024-02-27T14:02:59.220+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 2, "v": 0, "delay": "100ms"}
2024-02-27T14:02:59.220+0300	DEBUG	[email protected]/check.go:29	check preparations	{"hasReq": true, "count": 1, "M": 1}
2024-02-27T14:02:59.220+0300	INFO	[email protected]/send.go:134	sending Commit	{"height": 2, "view": 0}
2024-02-27T14:02:59.221+0300	DEBUG	[email protected]/send.go:9	broadcasting message	{"type": "Commit", "height": 2, "view": 0}
2024-02-27T14:02:59.221+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 2, "v": 0, "delay": "100ms"}
2024-02-27T14:02:59.221+0300	INFO	[email protected]/check.go:66	approving block	{"height": 2, "hash": "e52d6b09becd575bdb33a49502f7e8a4b3d581481428f9f8640f6a8910e97004", "tx_count": 1, "merkle": "1b1c50a37924361ba59b2f0b1d051b12a4a4a27bd1f9fabbb027834705de214e", "prev": "55dfd8f2884f5f17abd9f2d7d1d6ffa7b0e3df419de8eec9a6d8cfd135ee0af2"}
    logger.go:130: 2024-02-27T14:02:59.222+0300	DEBUG	done processing headers	{"headerIndex": 2, "blockHeight": 1, "took": "395.044µs"}
    logger.go:130: 2024-02-27T14:02:59.222+0300	INFO	sending block event	{"index": 2}
    logger.go:130: 2024-02-27T14:02:59.223+0300	INFO	sent block event	{"index": 2}
    logger.go:130: 2024-02-27T14:02:59.223+0300	INFO	ntf dispatcher: event	{"index": 2, "len(blockFeed)": 2}
2024-02-27T14:02:59.223+0300	DEBUG	consensus/consensus.go:382	new block in the chain	{"dbft index": 2, "chain index": 2}
2024-02-27T14:02:59.223+0300	INFO	[email protected]/dbft.go:107	initializing dbft	{"height": 3, "view": 0, "index": 0, "role": "Primary"}
2024-02-27T14:02:59.223+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 3, "v": 0, "delay": "98.305019ms"}
    logger.go:130: 2024-02-27T14:02:59.223+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:02:59.223+0300	INFO	cleanup started
    logger.go:130: 2024-02-27T14:02:59.223+0300	INFO	shutting down RPC server	{"endpoint": "127.0.0.1:37689"}
    logger.go:130: 2024-02-27T14:02:59.223+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:02:59.223+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:02:59.223+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:02:59.224+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:02:59.224+0300	INFO	ntf dispatcher: unsubscribe
2024-02-27T14:02:59.224+0300	INFO	consensus/consensus.go:292	stopping consensus service
    logger.go:130: 2024-02-27T14:02:59.224+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:02:59.224+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:02:59.224+0300	INFO	persisted to disk	{"blocks": 2, "keys": 166, "headerHeight": 2, "blockHeight": 2, "took": "161.923µs"}
--- PASS: TestQueryTx (0.11s)
PASS

Process finished with the exit code 0

Failed test run happens when block 1 is being announced by the blockchain prior to consensus service subscription, and hence, consensus service don't have any way to react on the accepted block (it's not subscribed to blocks yet):

GOROOT=/usr/local/go #gosetup
GOPATH=/home/anna/go #gosetup
/usr/local/go/bin/go test -c -o /home/anna/.cache/JetBrains/GoLand2023.3/tmp/GoLand/___TestQueryTx_in_github_com_nspcc_dev_neo_go_cli_query.test github.com/nspcc-dev/neo-go/cli/query #gosetup
/usr/local/go/bin/go tool test2json -t /home/anna/.cache/JetBrains/GoLand2023.3/tmp/GoLand/___TestQueryTx_in_github_com_nspcc_dev_neo_go_cli_query.test -test.v -test.paniconexit0 -test.run ^\QTestQueryTx\E$
=== RUN   TestQueryTx
    logger.go:130: 2024-02-27T14:07:14.686+0300	INFO	initial gas supply is not set or wrong, setting default value	{"InitialGASSupply": "52000000"}
    logger.go:130: 2024-02-27T14:07:14.686+0300	INFO	P2PNotaryRequestPayloadPool size is not set or wrong, setting default value	{"P2PNotaryRequestPayloadPoolSize": 1000}
    logger.go:130: 2024-02-27T14:07:14.686+0300	INFO	MaxBlockSize is not set or wrong, setting default value	{"MaxBlockSize": 262144}
    logger.go:130: 2024-02-27T14:07:14.686+0300	INFO	MaxBlockSystemFee is not set or wrong, setting default value	{"MaxBlockSystemFee": 900000000000}
    logger.go:130: 2024-02-27T14:07:14.686+0300	INFO	MaxTransactionsPerBlock is not set or wrong, using default value	{"MaxTransactionsPerBlock": 512}
    logger.go:130: 2024-02-27T14:07:14.686+0300	INFO	MaxValidUntilBlockIncrement is not set or wrong, using default value	{"MaxValidUntilBlockIncrement": 864000}
    logger.go:130: 2024-02-27T14:07:14.687+0300	INFO	no storage version found! creating genesis block
2024-02-27T14:07:14.688+0300	INFO	consensus/consensus.go:281	starting consensus service
2024-02-27T14:07:14.688+0300	INFO	[email protected]/dbft.go:107	initializing dbft	{"height": 1, "view": 0, "index": 0, "role": "Primary"}
2024-02-27T14:07:14.688+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 1, "v": 0, "delay": "0s"}
2024-02-27T14:07:14.688+0300	DEBUG	[email protected]/send.go:9	broadcasting message	{"type": "PrepareRequest", "height": 1, "view": 0}
2024-02-27T14:07:14.688+0300	INFO	[email protected]/send.go:40	sending PrepareRequest	{"height": 1, "view": 0}
2024-02-27T14:07:14.688+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 1, "v": 0, "delay": "100ms"}
2024-02-27T14:07:14.688+0300	DEBUG	[email protected]/check.go:29	check preparations	{"hasReq": true, "count": 1, "M": 1}
2024-02-27T14:07:14.688+0300	INFO	[email protected]/send.go:134	sending Commit	{"height": 1, "view": 0}
2024-02-27T14:07:14.688+0300	DEBUG	[email protected]/send.go:9	broadcasting message	{"type": "Commit", "height": 1, "view": 0}
2024-02-27T14:07:14.689+0300	DEBUG	[email protected]/dbft.go:617	reset timer	{"h": 1, "v": 0, "delay": "100ms"}
2024-02-27T14:07:14.689+0300	INFO	[email protected]/check.go:66	approving block	{"height": 1, "hash": "b5deba6210f801eae81619c7d1f0fc2fae987245040f22ec2e7f2d47a55ad2a8", "tx_count": 0, "merkle": "0000000000000000000000000000000000000000000000000000000000000000", "prev": "fe78c256de052957c4b40d2dceae1deb9074fafaaa4f5f600e64230e60015b62"}
    logger.go:130: 2024-02-27T14:07:14.689+0300	INFO	MaxIteratorResultItems is not set or wrong, setting default value	{"MaxIteratorResultItems": 100}
    logger.go:130: 2024-02-27T14:07:14.689+0300	INFO	MaxFindResultItems is not set or wrong, setting default value	{"MaxFindResultItems": 100}
    logger.go:130: 2024-02-27T14:07:14.689+0300	INFO	MaxFindStorageResultItems is not set or wrong, setting default value	{"MaxFindStorageResultItems": 50}
    logger.go:130: 2024-02-27T14:07:14.689+0300	INFO	MaxNEP11Tokens is not set or wrong, setting default value	{"MaxNEP11Tokens": 100}
    logger.go:130: 2024-02-27T14:07:14.689+0300	INFO	MaxRequestBodyBytes is not set or wong, setting default value	{"MaxRequestBodyBytes": 5242880}
    logger.go:130: 2024-02-27T14:07:14.689+0300	INFO	MaxRequestHeaderBytes is not set or wong, setting default value	{"MaxRequestHeaderBytes": 1048576}
    logger.go:130: 2024-02-27T14:07:14.689+0300	INFO	MaxWebSocketClients is not set or wrong, setting default value	{"MaxWebSocketClients": 64}
    logger.go:130: 2024-02-27T14:07:14.689+0300	INFO	starting rpc-server	{"endpoint": "127.0.0.1:0"}
    logger.go:130: 2024-02-27T14:07:14.689+0300	DEBUG	done processing headers	{"headerIndex": 1, "blockHeight": 0, "took": "532.125µs"}
    logger.go:130: 2024-02-27T14:07:14.690+0300	INFO	sending block event	{"index": 1}
    logger.go:130: 2024-02-27T14:07:14.691+0300	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
    logger.go:130: 2024-02-27T14:07:14.691+0300	DEBUG	processing rpc request	{"method": "getnativecontracts", "params": "[]"}
    logger.go:130: 2024-02-27T14:07:14.694+0300	DEBUG	processing rpc request	{"method": "getversion", "params": "[]"}
    logger.go:130: 2024-02-27T14:07:14.694+0300	DEBUG	processing rpc request	{"method": "getnep17balances", "params": "[56c989e76f9a2ca05bb5caa6c96f524d905accd8]"}
    logger.go:130: 2024-02-27T14:07:14.694+0300	DEBUG	processing rpc request	{"method": "invokescript", "params": "[CxEMFNwk6EPkEi4hj1BzCuuZPYVDDVeBDBTYzFqQTVJvyabKtVugLJpv54nJVhTAHwwIdHJhbnNmZXIMFPVj6kC8KD1NDgXEjqMFs/Kgc0DvQWJ9W1I5 ]"}
    logger.go:130: 2024-02-27T14:07:14.695+0300	DEBUG	processing rpc request	{"method": "getblockcount", "params": "[]"}
    logger.go:130: 2024-02-27T14:07:14.696+0300	DEBUG	processing rpc request	{"method": "calculatenetworkfee", "params": "[AFIYXm60P5gAAAAAAAAAAAAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAVwsRDBTcJOhD5BIuIY9QcwrrmT2FQw1XgQwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQEAKhEMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwhFBntDcOg==]"}
    logger.go:130: 2024-02-27T14:07:14.696+0300	DEBUG	processing rpc request	{"method": "sendrawtransaction", "params": "[AFIYXm60P5gAAAAAAPTGEgAAAAAABAAAAAHYzFqQTVJvyabKtVugLJpv54nJVgEAVwsRDBTcJOhD5BIuIY9QcwrrmT2FQw1XgQwU2MxakE1Sb8mmyrVboCyab+eJyVYUwB8MCHRyYW5zZmVyDBT1Y+pAvCg9TQ4FxI6jBbPyoHNA70FifVtSOQFCDEBeuST7kfHmKCT4rYI/LgAmimZcimmKUo4UoSsG+yzbs3gXIRoHc81ka73Ub0DlfZ5D58sZULBp9tXiO/uZOPLrKhEMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwhFBntDcOg==]"}
    logger.go:130: 2024-02-27T14:07:14.697+0300	INFO	running blockchain
    logger.go:130: 2024-02-27T14:07:14.697+0300	INFO	running notification dispatcher
    logger.go:130: 2024-02-27T14:07:14.697+0300	INFO	ntf dispatcher: event	{"index": 1, "len(blockFeed)": 0}
    logger.go:130: 2024-02-27T14:07:14.697+0300	INFO	ntf dispatcher: subscribe blocks
    logger.go:130: 2024-02-27T14:07:14.697+0300	INFO	ntf dispatcher: subscribe blocks
    logger.go:130: 2024-02-27T14:07:14.697+0300	INFO	sent block event	{"index": 1}
2024-02-27T14:07:14.789+0300	DEBUG	consensus/consensus.go:313	timer fired	{"height": 1, "view": 0}
    logger.go:130: 2024-02-27T14:07:14.798+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:14.898+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:14.998+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.098+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.197+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.298+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.398+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.498+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.597+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.698+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.698+0300	INFO	persisted to disk	{"blocks": 1, "keys": 139, "headerHeight": 1, "blockHeight": 1, "took": "67.524µs"}
    logger.go:130: 2024-02-27T14:07:15.798+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.898+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:15.998+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:16.097+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:16.198+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:16.298+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:16.398+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:16.497+0300	INFO	query tx
    logger.go:130: 2024-02-27T14:07:16.598+0300	INFO	query tx
    executor.go:220: 
        	Error Trace:	/home/anna/Documents/GitProjects/nspcc-dev/neo-go/internal/testcli/executor.go:220
        	            				/home/anna/Documents/GitProjects/nspcc-dev/neo-go/cli/query/query_test.go:56
        	Error:      	Condition never satisfied
        	Test:       	TestQueryTx
        	Messages:   	too long time waiting for block
    logger.go:130: 2024-02-27T14:07:16.698+0300	INFO	cleanup started
    logger.go:130: 2024-02-27T14:07:16.698+0300	INFO	shutting down RPC server	{"endpoint": "127.0.0.1:37603"}
    logger.go:130: 2024-02-27T14:07:16.698+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:07:16.698+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:07:16.698+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:07:16.698+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:07:16.699+0300	INFO	ntf dispatcher: unsubscribe
2024-02-27T14:07:16.699+0300	INFO	consensus/consensus.go:292	stopping consensus service
    logger.go:130: 2024-02-27T14:07:16.699+0300	INFO	ntf dispatcher: unsubscribe
    logger.go:130: 2024-02-27T14:07:16.699+0300	INFO	ntf dispatcher: unsubscribe
--- FAIL: TestQueryTx (2.01s)

FAIL

Process finished with the exit code 1

Previously user should Start server in a separate goroutine. Now
separate goroutine is created inside the Start(). For normal server
operation, the caller should wait for Start to finish. Also, fixed
TestTryInitStateSync test which was exiting earlier than logs are
called.

Close #3112

Signed-off-by: Ekaterina Pavlova <[email protected]>
Start of some services is bound to blockchain subscriptions, and thus,
can't be run before the blockchain notifications dispatcher.

Signed-off-by: Ekaterina Pavlova <[email protected]>
Use started atomic.Bool field to ensure that the node server shutdown
procedure is executed only once. Prevent the following panic caused by
server double-shutdown in testing code:
```
--- FAIL: TestServerRegisterPeer (0
.06s)
 panic: closed twice
 goroutine 60 [running]:
 testing.tRunner.func1.2({0x104c40b20, 0x104d0ec90})
 	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1545 +0x1c8
 testing.tRunner.func1()
 	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1548 +0x360
 panic({0x104c40b20?, 0x104d0ec90?})
 	/opt/homebrew/opt/go/libexec/src/runtime/panic.go:914 +0x218
 github.com/nspcc-dev/neo-go/pkg/network.(*fakeTransp).Close
 (0x14000159e08?)
 	/Users/ekaterinapavlova/Workplace/neo-go/pkg/network
 	/discovery_test.go:83 +0x54
 github.com/nspcc-dev/neo-go/pkg/network.(*Server).Shutdown
 (0x14000343400)
 	/Users/ekaterinapavlova/Workplace/neo-go/pkg/network/server.go:299
 	 +0x104
 github.com/nspcc-dev/neo-go/pkg/network.startWithCleanup.func1()
 	/Users/ekaterinapavlova/Workplace/neo-go/pkg/network/server_test
 	.go:408 +0x20
 testing.(*common).Cleanup.func1()
 	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1169 +0x110
 testing.(*common).runCleanup(0x1400032c340, 0x14000159d80?)
 	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1347 +0xd8
 testing.tRunner.func2()
 	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1589 +0x2c
 testing.tRunner(0x1400032c340, 0x104d0c5d0)
 	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1601 +0x114
 created by testing.(*T).Run in goroutine 1
 	/opt/homebrew/opt/go/libexec/src/testing/testing.go:1648 +0x33c
```

Signed-off-by: Ekaterina Pavlova <[email protected]>
Signed-off-by: Ekaterina Pavlova <[email protected]>
Added sync logs for every service separately to provide the ability to
have a custom logger for each service. This commit makes the code follow
the zap usages rules: `Sync calls the underlying Core's Sync method,
flushing any buffered log entries. Applications should take care to
call Sync before exiting.`

Signed-off-by: Ekaterina Pavlova <[email protected]>
s.Shutdown() does not wait for all goroutines of the node server to
finish normally just because the server exits without dependent
goroutines awaiting. Which causes logs to attempt to write after the
test has ended. The consequence of this bug fix is that corresponding
tests are fixed.

Close #2973
Close #2974

Signed-off-by: Ekaterina Pavlova <[email protected]>
@AliceInHunterland
Copy link
Contributor Author

AliceInHunterland commented Feb 27, 2024

got similar to #2977 (comment) on windows Run tests (windows-2022, 1.21) -probably not connected with current changes

NAME  TestClient_IteratorSessions/traverse,_concurrent_access
2024-02-27T12:28:36.1047187Z     client_test.go:1547: 
2024-02-27T12:28:36.1047782Z         	Error Trace:	D:/a/neo-go/neo-go/pkg/services/rpcsrv/client_test.go:1547
2024-02-27T12:28:36.1048498Z         	            				C:/hostedtoolcache/windows/go/1.21.7/x64/src/runtime/asm_amd64.s:1650
2024-02-27T12:28:36.1048710Z         	Error:      	Received unexpected error:
2024-02-27T12:28:36.1049994Z         	            	Post "http://127.0.0.1:61547": dial tcp 127.0.0.1:61547: connectex: No connection could be made because the target machine actively refused it.
2024-02-27T12:28:36.1050366Z         	Test:       	TestClient_IteratorSessions/traverse,_concurrent_access
2024-02-27T12:28:36.1050577Z     client_test.go:1547: 
2024-02-27T12:28:36.1051059Z         	Error Trace:	D:/a/neo-go/neo-go/pkg/services/rpcsrv/client_test.go:1547
2024-02-27T12:28:36.1051789Z         	            				C:/hostedtoolcache/windows/go/1.21.7/x64/src/runtime/asm_amd64.s:1650
2024-02-27T12:28:36.1052000Z         	Error:      	Received unexpected error:
2024-02-27T12:28:36.1053287Z         	            	Post "http://127.0.0.1:61547": dial tcp 127.0.0.1:61547: connectex: No connection could be made because the target machine actively refused it.
2024-02-27T12:28:36.1053642Z         	Test:       	TestClient_IteratorSessions/traverse,_concurrent_access
2024-02-27T12:28:36.1053768Z     client_test.go:1547: 

@AnnaShaleva
Copy link
Member

got similar to #2977 (comment) on windows Run tests (windows-2022, 1.21)

NAME  TestClient_IteratorSessions/traverse,_concurrent_access
2024-02-27T12:28:36.1047187Z     client_test.go:1547: 
2024-02-27T12:28:36.1047782Z         	Error Trace:	D:/a/neo-go/neo-go/pkg/services/rpcsrv/client_test.go:1547
2024-02-27T12:28:36.1048498Z         	            				C:/hostedtoolcache/windows/go/1.21.7/x64/src/runtime/asm_amd64.s:1650
2024-02-27T12:28:36.1048710Z         	Error:      	Received unexpected error:
2024-02-27T12:28:36.1049994Z         	            	Post "http://127.0.0.1:61547": dial tcp 127.0.0.1:61547: connectex: No connection could be made because the target machine actively refused it.
2024-02-27T12:28:36.1050366Z         	Test:       	TestClient_IteratorSessions/traverse,_concurrent_access
2024-02-27T12:28:36.1050577Z     client_test.go:1547: 
2024-02-27T12:28:36.1051059Z         	Error Trace:	D:/a/neo-go/neo-go/pkg/services/rpcsrv/client_test.go:1547
2024-02-27T12:28:36.1051789Z         	            				C:/hostedtoolcache/windows/go/1.21.7/x64/src/runtime/asm_amd64.s:1650
2024-02-27T12:28:36.1052000Z         	Error:      	Received unexpected error:
2024-02-27T12:28:36.1053287Z         	            	Post "http://127.0.0.1:61547": dial tcp 127.0.0.1:61547: connectex: No connection could be made because the target machine actively refused it.
2024-02-27T12:28:36.1053642Z         	Test:       	TestClient_IteratorSessions/traverse,_concurrent_access
2024-02-27T12:28:36.1053768Z     client_test.go:1547: 

It's not related to this PR, create a separate issue or add these logs to an existing one if it's the same problem.

@roman-khimov roman-khimov merged commit cc38221 into master Feb 27, 2024
30 of 35 checks passed
@roman-khimov roman-khimov deleted the test-register-peers branch February 27, 2024 14:09
@roman-khimov roman-khimov mentioned this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants