ssbc / go-ssb

Go implementation of ssb (work in progress!)
https://scuttlebutt.nz
160 stars 26 forks source link

Fix TestBadger #313

Closed KyleMaas closed 1 year ago

KyleMaas commented 1 year ago

Adds a WaitGroup and associated logic so that BadgerBuilder queries wait until the indexes have caught up. This also means we can eliminate the Sleep() calls in the test, since it's now based on work being done rather than arbitrary times (other than the short built-in delay to get around Luigi not having a "queue empty" query system).

Fixes #266

KyleMaas commented 1 year ago

Oh, I should note I ran this test over 1000 times without any failures.

KyleMaas commented 1 year ago

Thanks!