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

peer/peer_test: Fix race conditions in peer test. #212

Closed
wants to merge 1 commit into from
Closed

peer/peer_test: Fix race conditions in peer test. #212

wants to merge 1 commit into from

Conversation

johnsonjh
Copy link

@johnsonjh johnsonjh commented Nov 17, 2020

Previously, these tests had unavoidable race issues due to relying on perfect timing - instead, rely on a time range which eliminates the issue while still maintaining the effectiveness of the test.

 » go test -count=500000 -cpu=1,12,128 -timeout=0 . 
ok  	github.com/pkt-cash/pktd/peer	1607.208s

 » go test -count=1000 -cpu=12 -race -timeout=0 .
ok  	github.com/pkt-cash/pktd/peer	21.322s

@cjdelisle
Copy link
Member

conflict

@johnsonjh
Copy link
Author

I'll rebase.

@johnsonjh
Copy link
Author

@cjdelisle rebased

@johnsonjh
Copy link
Author

@johnsonjh
Copy link
Author

  • NOTE: Applied to WIP rebase branch successfully.

@johnsonjh johnsonjh closed this Dec 28, 2020
@johnsonjh johnsonjh deleted the peertest_racy branch December 28, 2020 23:52
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.

2 participants