Commit bc2f3bdf authored by David Vorick's avatar David Vorick

address contractor ndf; bump travis to go 1.10

parent f4678bf4
......@@ -4,7 +4,7 @@ os:
- linux
go:
- 1.9
- "1.10"
install:
- make dependencies
......
package contractor
import (
"errors"
"testing"
"time"
......@@ -9,6 +8,8 @@ import (
"github.com/NebulousLabs/Sia/crypto"
"github.com/NebulousLabs/Sia/modules"
"github.com/NebulousLabs/Sia/types"
"github.com/NebulousLabs/errors"
"github.com/NebulousLabs/fastrand"
)
......@@ -171,15 +172,19 @@ func TestIntegrationRenewInvalidate(t *testing.T) {
t.Fatal(err)
}
}
// wait for goroutine in ProcessConsensusChange to finish
time.Sleep(100 * time.Millisecond)
c.maintenanceLock.Lock()
c.maintenanceLock.Unlock()
// downloader should have been invalidated
_, err = downloader.Sector(crypto.Hash{})
if err != errInvalidDownloader {
t.Error("expected invalid downloader error; got", err)
err = build.Retry(50, 100*time.Millisecond, func() error {
// wait for goroutine in ProcessConsensusChange to finish
c.maintenanceLock.Lock()
c.maintenanceLock.Unlock()
_, err2 := downloader.Sector(crypto.Hash{})
if err2 != errInvalidDownloader {
return errors.AddContext(err, "expected invalid downloader error")
}
return downloader.Close()
})
if err != nil {
t.Fatal(err)
}
downloader.Close()
}
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