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

Fix failing test case because of wrong TimeOffset #543

Merged
merged 1 commit into from Nov 9, 2015

Conversation

tuxcanfly
Copy link
Contributor

In rare cases, the build fails with the error:

--- FAIL: TestPeerConnection (0.01s)
    peer_test.go:296: Running 2 tests
    peer_test.go:155: testPeer: wrong TimeOffset - got -1, want 0

https://travis-ci.org/btcsuite/btcd/jobs/87692240#L542

One reason this might happen is when the current timestamp is 1s ahead of the message timestamp and the tick happens when the message is in transit.

Since the protocol is limited to one second precision, we do not have enough data to compare the timestamps any further. Therefore, I guess there will be some peer connections which inadvertently have an offset of 1s. Updated the test case to handle this.

Review on Reviewable

@davecgh
Copy link
Member

davecgh commented Nov 9, 2015

OK

@davecgh
Copy link
Member

davecgh commented Nov 9, 2015

Needs rebase though.

@tuxcanfly
Copy link
Contributor Author

OK, rebased.

@conformal-deploy conformal-deploy merged commit 21d11e2 into btcsuite:master Nov 9, 2015
@tuxcanfly tuxcanfly deleted the fix-timeoffset-test branch November 9, 2015 23:53
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.

None yet

3 participants