log_size_monitor shouldn't fail test in case of error

This commit is contained in:
gmarek 2015-12-23 10:15:49 +01:00
parent e5d4663dd8
commit 0e3c33bdec

View File

@ -196,7 +196,7 @@ func (g *LogSizeGatherer) Run() {
// Work does a single unit of work: tries to take out a WorkItem from the queue, ssh-es into a given machine, // Work does a single unit of work: tries to take out a WorkItem from the queue, ssh-es into a given machine,
// gathers data, writes it to the shared <data> map, and creates a gorouting which reinserts work item into // gathers data, writes it to the shared <data> map, and creates a gorouting which reinserts work item into
// the queue with a <pollingPeriod> delay. // the queue with a <pollingPeriod> delay. Returns false if worker should exit.
func (g *LogSizeGatherer) Work() bool { func (g *LogSizeGatherer) Work() bool {
var workItem WorkItem var workItem WorkItem
select { select {
@ -210,14 +210,21 @@ func (g *LogSizeGatherer) Work() bool {
workItem.ip, workItem.ip,
testContext.Provider, testContext.Provider,
) )
expectNoError(err) if err != nil {
Logf("Error while trying to SSH to %v, skipping probe.", workItem.ip)
g.workChannel <- workItem
return true
}
results := strings.Split(sshResult.Stdout, " ") results := strings.Split(sshResult.Stdout, " ")
now := time.Now() now := time.Now()
for i := 0; i+1 < len(results); i = i + 2 { for i := 0; i+1 < len(results); i = i + 2 {
path := results[i] path := results[i]
size, err := strconv.Atoi(results[i+1]) size, err := strconv.Atoi(results[i+1])
expectNoError(err) if err != nil {
Logf("Error during conversion to int: %v, skipping data", results[i+1])
continue
}
g.data.AddNewData(workItem.ip, path, now, size) g.data.AddNewData(workItem.ip, path, now, size)
} }
go func() { go func() {