Merge pull request #5397 from filecoin-project/fix/sync-manager-test-flake

fix a flake in the sync manager edge case test
This commit is contained in:
Łukasz Magiera 2021-01-21 10:18:27 +01:00 committed by GitHub
commit e5efe57c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,6 +117,13 @@ func TestSyncManagerEdgeCase(t *testing.T) {
// get the next sync target; it should be c1 as the heaviest tipset but added last (same weight as c2)
bop = <-stc
if bop.ts.Equals(c2) {
// there's a small race and we might get c2 first.
// But we should still end on c1.
bop.done()
bop = <-stc
}
if !bop.ts.Equals(c1) {
t.Fatalf("Expected tipset %s to sync, but got %s", c1, bop.ts)
}