Don't pass empty row to channel on error
This commit is contained in:
parent
6a86de87b4
commit
d77f3fe012
@ -27,7 +27,8 @@ func (storageFetcher CsvTailStorageFetcher) FetchStorageDiffs(out chan<- utils.S
|
||||
row, parseErr := utils.FromStrings(strings.Split(line.Text, ","))
|
||||
if parseErr != nil {
|
||||
errs <- parseErr
|
||||
}
|
||||
} else {
|
||||
out <- row
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,12 @@ var _ = Describe("Csv Tail Storage Fetcher", func() {
|
||||
mockTailer.Lines <- line
|
||||
|
||||
Expect(<-errorsChannel).To(HaveOccurred())
|
||||
select {
|
||||
case <-rowsChannel:
|
||||
Fail("value passed to rows channel on error")
|
||||
default:
|
||||
Succeed()
|
||||
}
|
||||
close(done)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user