Get the owned ranges for test purposes via the actor loop, so we don't set off the race detector

This commit is contained in:
Bryan Boreham committed 2016-03-19 15:29:34 +00:00
1 parent 71ec252298
commit 09a6c2eda0
2 files changed
+11 -3

No files matched your search

+8
View File
@@ -175,6 +175,14 @@ func (alloc *Allocator) NumFreeAddresses(r address.Range) address.Count {
return <-resultChan
}
func (alloc *Allocator) OwnedRanges() (result []address.Range) {
resultChan := make(chan []address.Range)
alloc.actionChan <- func() {
resultChan <- alloc.ring.OwnedRanges()
}
return <-resultChan
}
// Check whether or not something was sent on a channel
func AssertSent(t *testing.T, ch <-chan bool) {
timeout := time.After(10 * time.Second)