diff --git a/chain/sync_manager_test.go b/chain/sync_manager_test.go index a5ff033ac..5f23e67c0 100644 --- a/chain/sync_manager_test.go +++ b/chain/sync_manager_test.go @@ -150,8 +150,11 @@ func TestSyncManagerEdgeCase(t *testing.T) { t.Fatalf("Expected tipset %s to sync, but got %s", e1, last) } - if len(sm.state) != 0 { - t.Errorf("active syncs expected empty but got: %d", len(sm.state)) + sm.mx.Lock() + activeSyncs := len(sm.state) + sm.mx.Unlock() + if activeSyncs != 0 { + t.Errorf("active syncs expected empty but got: %d", activeSyncs) } }) }