mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-28 16:01:29 +00:00
Fix more test bugs. One last reorg bug to fix before moving on.
This commit is contained in:
parent
738d889e3d
commit
f2aceaf363
1 changed files with 25 additions and 7 deletions
|
@ -152,20 +152,38 @@ func TestSetup(t *testing.T) {
|
||||||
t.Fatalf("Couldn't sync ChainService: %v", err)
|
t.Fatalf("Couldn't sync ChainService: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate 150 blocks on h1 to make sure it reorgs the other nodes.
|
// Generate 125 blocks on h1 to make sure it reorgs the other nodes.
|
||||||
// Ensure the ChainService instance stays caught up.
|
// Ensure the ChainService instance stays caught up.
|
||||||
h1.Node.Generate(150)
|
h1.Node.Generate(125)
|
||||||
err = waitForSync(t, svc, h1, time.Second, 30*time.Second)
|
err = waitForSync(t, svc, h1, time.Second, 30*time.Second)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Couldn't sync ChainService: %v", err)
|
t.Fatalf("Couldn't sync ChainService: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect/sync/disconnect the other nodes to make them reorg to the h1
|
// Connect/sync/disconnect h2 to make it reorg to the h1 chain.
|
||||||
// chain.
|
err = csd([]*rpctest.Harness{h1, h2})
|
||||||
/*err = csd([]*rpctest.Harness{h1, h2, h3})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Couldn't sync h2 and h3 to h1: %v", err)
|
t.Fatalf("Couldn't sync h2 to h1: %v", err)
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
// Generate 3 blocks on h1, one at a time, to make sure the
|
||||||
|
// ChainService instance stays caught up.
|
||||||
|
for i := 0; i < 3; i++ {
|
||||||
|
h1.Node.Generate(1)
|
||||||
|
err = waitForSync(t, svc, h1, time.Second, 30*time.Second)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Couldn't sync ChainService: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate 5 blocks on h2.
|
||||||
|
h2.Node.Generate(5)
|
||||||
|
|
||||||
|
// Wait for ChainService to sync to the newly-best chain on h12
|
||||||
|
err = waitForSync(t, svc, h2, time.Second, 30*time.Second)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Couldn't sync ChainService: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// csd does a connect-sync-disconnect between nodes in order to support
|
// csd does a connect-sync-disconnect between nodes in order to support
|
||||||
|
|
Loading…
Add table
Reference in a new issue