diff --git a/tests/sync/connectblocks.go b/tests/sync/connectblocks.go index 41c9f0e9..57357808 100644 --- a/tests/sync/connectblocks.go +++ b/tests/sync/connectblocks.go @@ -27,20 +27,17 @@ func testConnectBlocks(t *testing.T, h *TestHandler) { } }, true) if err != nil { - if err.Error() != fmt.Sprintf("connectBlocks interrupted at height %d", rng.Upper) { + if !strings.HasPrefix(err.Error(), "connectBlocks interrupted at height") { t.Fatal(err) } } - height, hash, err := d.GetBestBlock() + height, _, err := d.GetBestBlock() if err != nil { t.Fatal(err) } - if height != rng.Upper { - t.Fatalf("Upper block height mismatch: %d != %d", height, rng.Upper) - } - if hash != upperHash { - t.Fatalf("Upper block hash mismatch: %s != %s", hash, upperHash) + if height < rng.Upper { + t.Fatalf("Best block height mismatch: %d < %d", height, rng.Upper) } t.Run("verifyBlockInfo", func(t *testing.T) { verifyBlockInfo(t, d, h, rng) }) @@ -68,10 +65,10 @@ func testConnectBlocksParallel(t *testing.T, h *TestHandler) { t.Fatal(err) } if height != rng.Upper { - t.Fatalf("Upper block height mismatch: %d != %d", height, rng.Upper) + t.Fatalf("Best block height mismatch: %d != %d", height, rng.Upper) } if hash != upperHash { - t.Fatalf("Upper block hash mismatch: %s != %s", hash, upperHash) + t.Fatalf("Best block hash mismatch: %s != %s", hash, upperHash) } t.Run("verifyBlockInfo", func(t *testing.T) { verifyBlockInfo(t, d, h, rng) })