Merge pull request #11543 from ahmetalpbalkan/TestBuildSpaces

integ-cli: fix bug and race in TestBuildSpaces
This commit is contained in:
Doug Davis 2015-03-21 19:20:17 -04:00
Родитель b6e20a67f9 28a34dfffd
Коммит 4c443facf4
1 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -5124,9 +5124,13 @@ func TestBuildSpaces(t *testing.T) {
t.Fatal("Build 2 was supposed to fail, but didn't")
}
removeLogTimestamps := func(s string) string {
return regexp.MustCompile(`time="(.*?)"`).ReplaceAllString(s, `time=[TIMESTAMP]`)
}
// Skip over the times
e1 := err1.Error()[strings.Index(err1.Error(), `level=`):]
e2 := err2.Error()[strings.Index(err1.Error(), `level=`):]
e1 := removeLogTimestamps(err1.Error())
e2 := removeLogTimestamps(err2.Error())
// Ignore whitespace since that's what were verifying doesn't change stuff
if strings.Replace(e1, " ", "", -1) != strings.Replace(e2, " ", "", -1) {
@ -5139,8 +5143,8 @@ func TestBuildSpaces(t *testing.T) {
}
// Skip over the times
e1 = err1.Error()[strings.Index(err1.Error(), `level=`):]
e2 = err2.Error()[strings.Index(err1.Error(), `level=`):]
e1 = removeLogTimestamps(err1.Error())
e2 = removeLogTimestamps(err2.Error())
// Ignore whitespace since that's what were verifying doesn't change stuff
if strings.Replace(e1, " ", "", -1) != strings.Replace(e2, " ", "", -1) {
@ -5153,8 +5157,8 @@ func TestBuildSpaces(t *testing.T) {
}
// Skip over the times
e1 = err1.Error()[strings.Index(err1.Error(), `level=`):]
e2 = err2.Error()[strings.Index(err1.Error(), `level=`):]
e1 = removeLogTimestamps(err1.Error())
e2 = removeLogTimestamps(err2.Error())
// Ignore whitespace since that's what were verifying doesn't change stuff
if strings.Replace(e1, " ", "", -1) != strings.Replace(e2, " ", "", -1) {