Merge pull request #3400 from nspcc-dev/fix-TestServerStartAndShutdown

network: take care of TestServerStartAndShutdown
This commit is contained in:
Roman Khimov 2024-04-04 13:56:22 +03:00 committed by GitHub
commit f553f77d20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -95,8 +95,10 @@ func TestServerStartAndShutdown(t *testing.T) {
s.register <- p
require.Eventually(t, func() bool { return 1 == s.PeerCount() }, time.Second, time.Millisecond*10)
assert.True(t, s.transports[0].(*fakeTransp).started.Load())
require.True(t, s.started.Load())
require.Eventually(t, func() bool {
return s.transports[0].(*fakeTransp).started.Load()
}, 2*time.Second, 200*time.Millisecond)
assert.Nil(t, s.txCallback)
s.Shutdown()
@ -115,6 +117,7 @@ func TestServerStartAndShutdown(t *testing.T) {
s.Start()
p := newLocalPeer(t, s)
s.register <- p
require.Eventually(t, func() bool { return 1 == s.PeerCount() }, time.Second, time.Millisecond*10)
assert.True(t, s.services["fake"].(*fakeConsensus).started.Load())
require.True(t, s.started.Load())