Commit 32623a19 authored by Luke Champine's avatar Luke Champine

Merge branch 'TestAutoRevisionSubmission-ndf' into 'master'

Fix TestAutoRevisionSubmission NDf

Closes #3255

See merge request !3344
parents d2f9d9da 602adc23
Pipeline #38729775 failed with stages
in 115 minutes and 35 seconds
......@@ -717,36 +717,21 @@ func TestAutoRevisionSubmission(t *testing.T) {
// Unlike the other tests, this test does not submit the file contract
// revision to the transaction pool for the host, the host is expected to
// do it automatically.
// Mine until the host submits a storage proof.
for i := types.BlockHeight(0); i <= revisionSubmissionBuffer+2+resubmissionTimeout; i++ {
_, err := ht.miner.AddBlock()
if err != nil {
t.Fatal(err)
}
err = ht.host.tg.Flush()
if err != nil {
t.Fatal(err)
count := 0
err = build.Retry(500, 100*time.Millisecond, func() error {
// Mine another block every 10 iterations, to get the storage proof from
// the transaction pool into the blockchain.
if count%10 == 0 {
_, err = ht.miner.AddBlock()
if err != nil {
t.Fatal(err)
}
err = ht.host.tg.Flush()
if err != nil {
t.Fatal(err)
}
}
}
// Flush the host - flush will block until the host has submitted the
// storage proof to the transaction pool.
err = ht.host.tg.Flush()
if err != nil {
t.Fatal(err)
}
// Mine another block, to get the storage proof from the transaction pool
// into the blockchain.
_, err = ht.miner.AddBlock()
if err != nil {
t.Fatal(err)
}
err = ht.host.tg.Flush()
if err != nil {
t.Fatal(err)
}
err = build.Retry(50, 250*time.Millisecond, func() error {
count++
err = ht.host.db.View(func(tx *bolt.Tx) error {
so, err = getStorageObligation(tx, so.id())
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment