Skip to content

pool/store: Add more active vs inactive exercising for test suite, fix badger backend#77

Merged
shazow merged 4 commits intomasterfrom
test-update-peers
Sep 27, 2019
Merged

pool/store: Add more active vs inactive exercising for test suite, fix badger backend#77
shazow merged 4 commits intomasterfrom
test-update-peers

Conversation

@shazow
Copy link
Copy Markdown
Member

@shazow shazow commented Sep 25, 2019

TODO:

  • Fix failures on badger backend


// TestSuite runs a suite of tests against a store implementation.
func TestSuite(t *testing.T, newStore func() Store) {
nodes := []Node{}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this to avoid the temptation to mutate it (and risk causing side effects across tests)

@shazow shazow mentioned this pull request Sep 25, 2019
1 task
@shazow shazow marked this pull request as ready for review September 26, 2019 01:07
@shazow shazow changed the title pool/store: Add more active vs inactive exercising for test suite pool/store: Add more active vs inactive exercising for test suite, fix badger backend Sep 26, 2019
Copy link
Copy Markdown
Member Author

@shazow shazow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?
Copy link
Copy Markdown
Member Author

@shazow shazow Sep 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@ryanschneider ryanschneider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! 🎉

@shazow shazow merged commit 86489b2 into master Sep 27, 2019
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