Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log_size_monitor shouldn't fail test in case of error #19051

Merged
merged 1 commit into from
Dec 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 10 additions & 3 deletions test/e2e/log_size_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
// 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 {
var workItem WorkItem
select {
Expand All @@ -210,14 +210,21 @@ func (g *LogSizeGatherer) Work() bool {
workItem.ip,
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, " ")

now := time.Now()
for i := 0; i+1 < len(results); i = i + 2 {
path := results[i]
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)
}
go func() {
Expand Down