Skip to content

Commit

Permalink
Just validate size. Fixes issues on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
relistan committed Feb 14, 2017
1 parent d03d927 commit cde47ca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions haproxy/haproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ func Test_HAproxy(t *testing.T) {
})

Convey("Watch() writes out a config when the state changes", func() {
startTime := time.Now().Truncate(time.Second) // Localized to compare with os.Stat
tmpDir, _ := ioutil.TempDir("/tmp", "sidecar-test")
config := fmt.Sprintf("%s/haproxy.cfg", tmpDir)
proxy.ConfigFile = config
Expand All @@ -239,8 +238,7 @@ func Test_HAproxy(t *testing.T) {
for {
stat, _ := os.Stat(config)
if stat != nil {
if startTime.Before(stat.ModTime()) || startTime.Equal(stat.ModTime()) &&
stat.Size() > 10000 {
if stat.Size() > 10000 {
break
}
}
Expand Down

0 comments on commit cde47ca

Please sign in to comment.