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

network: take care of TestServerStartAndShutdown #3400

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

AnnaShaleva
Copy link
Member

We don't have a reliable way to know when transports are started since their start is being performed in a separate goroutine:

for _, tr := range s.transports {
go tr.Accept()
}

And transports start is not connected with main server routine, thus, just wait for some time for the transports goroutine to be started.

Also wait for the peer to be properly registered.

Close #3399.

We don't have a reliable way to know when transports are started since
their start is being performed in a separate goroutine:

https://github.com/nspcc-dev/neo-go/blob/927dbb6dc48d578ae731e5a067c82d0611642338/pkg/network/server.go#L297-L299

And transports start is not connected with main server routine, thus,
just wait for some time for the transports goroutine to be started.

Also wait for the peer to be properly registered.

Close #3399.

Signed-off-by: Anna Shaleva <[email protected]>
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.77%. Comparing base (927dbb6) to head (f84f072).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3400      +/-   ##
==========================================
- Coverage   84.86%   84.77%   -0.09%     
==========================================
  Files         331      331              
  Lines       44972    44972              
==========================================
- Hits        38164    38127      -37     
- Misses       5292     5330      +38     
+ Partials     1516     1515       -1     

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

@roman-khimov roman-khimov merged commit f553f77 into master Apr 4, 2024
19 of 20 checks passed
@roman-khimov roman-khimov deleted the fix-TestServerStartAndShutdown branch April 4, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestServerStartAndShutdown fails
2 participants