Skip to content

Commit

Permalink
resolves google#1030 oomparser_test should get the current year for m…
Browse files Browse the repository at this point in the history
…atching the time of death.
  • Loading branch information
pwittrock committed Jan 4, 2016
1 parent 0367672 commit dee3f07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/oomparser/oomparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ package oomparser

import (
"bufio"
"fmt"
"os"
"reflect"
"strconv"
"testing"
"time"
)
Expand Down Expand Up @@ -92,7 +94,8 @@ func TestGetProcessNamePid(t *testing.T) {
}

const longForm = "Jan _2 15:04:05 2006"
correctTime, err := time.ParseInLocation(longForm, "Jan 21 22:01:49 2015", time.Local)
stringYear := strconv.Itoa(time.Now().Year())
correctTime, err := time.ParseInLocation(longForm, fmt.Sprintf("Jan 21 22:01:49 %s", stringYear), time.Local)
couldParseLine, err = getProcessNamePid(endLine, currentOomInstance)
if err != nil {
t.Errorf("good line fed to getProcessNamePid should yield no error, but had error %v", err)
Expand Down

0 comments on commit dee3f07

Please sign in to comment.