Skip to content
This repository was archived by the owner on Nov 2, 2018. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bc2f3bd

Browse files
author
David Vorick
committedMay 10, 2018
address contractor ndf; bump travis to go 1.10
1 parent f4678bf commit bc2f3bd

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed
 

‎.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ os:
44
- linux
55

66
go:
7-
- 1.9
7+
- "1.10"
88

99
install:
1010
- make dependencies

‎modules/renter/contractor/update_test.go

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package contractor
22

33
import (
4-
"errors"
54
"testing"
65
"time"
76

87
"github.com/NebulousLabs/Sia/build"
98
"github.com/NebulousLabs/Sia/crypto"
109
"github.com/NebulousLabs/Sia/modules"
1110
"github.com/NebulousLabs/Sia/types"
11+
12+
"github.com/NebulousLabs/errors"
1213
"github.com/NebulousLabs/fastrand"
1314
)
1415

@@ -171,15 +172,19 @@ func TestIntegrationRenewInvalidate(t *testing.T) {
171172
t.Fatal(err)
172173
}
173174
}
174-
// wait for goroutine in ProcessConsensusChange to finish
175-
time.Sleep(100 * time.Millisecond)
176-
c.maintenanceLock.Lock()
177-
c.maintenanceLock.Unlock()
178175

179176
// downloader should have been invalidated
180-
_, err = downloader.Sector(crypto.Hash{})
181-
if err != errInvalidDownloader {
182-
t.Error("expected invalid downloader error; got", err)
177+
err = build.Retry(50, 100*time.Millisecond, func() error {
178+
// wait for goroutine in ProcessConsensusChange to finish
179+
c.maintenanceLock.Lock()
180+
c.maintenanceLock.Unlock()
181+
_, err2 := downloader.Sector(crypto.Hash{})
182+
if err2 != errInvalidDownloader {
183+
return errors.AddContext(err, "expected invalid downloader error")
184+
}
185+
return downloader.Close()
186+
})
187+
if err != nil {
188+
t.Fatal(err)
183189
}
184-
downloader.Close()
185190
}

0 commit comments

Comments
 (0)
This repository has been archived.