pool/store: Add more active vs inactive exercising for test suite, fix badger backend#77
Merged
pool/store: Add more active vs inactive exercising for test suite, fix badger backend#77
Conversation
Currently failing on the badger backend
shazow
commented
Sep 25, 2019
|
|
||
| // TestSuite runs a suite of tests against a store implementation. | ||
| func TestSuite(t *testing.T, newStore func() Store) { | ||
| nodes := []Node{} |
Member
Author
There was a problem hiding this comment.
Removed this to avoid the temptation to mutate it (and risk causing side effects across tests)
We were conflating node peer timestamps with node LastSeen
shazow
commented
Sep 26, 2019
Member
Author
shazow
left a comment
There was a problem hiding this comment.
Fairly subtle bug squashed!!
| for _, peer := range peers { | ||
| // Only update peers we already know about | ||
| // FIXME: If symmetric peers disappear at the same time, then reappear, will it be a problem if they never become inactive? (Okay if the balance manager caps the update interval?) | ||
| // FIXME: Should the timestamp update happen on the peerNode also? Or is it okay to leave it for the symmetric update call? |
Member
Author
There was a problem hiding this comment.
Turns out this question was the crux of the problem. :|
Banged my head at it for a while, then realized I was conflating the node's peer timestamps with the node's LastSeen in the badger implementation (whereas memory had this FIXME instead of actually doing it) which was breaking everything. Weeee!
Added more comments to the function to clarify the operating design and intent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO: