Skip to content

Commit

Permalink
container_test: read request on Unix Domain socket
Browse files Browse the repository at this point in the history
Trying to fix another flaky test. Probably the same problem as described
in the last commit.
  • Loading branch information
fsouza committed Apr 23, 2016
1 parent 87cfc9f commit 9aec3ae
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,21 @@ func TestStatsTimeout(t *testing.T) {
received := make(chan bool)
defer l.Close()
go func() {
l.Accept()
conn, err := l.Accept()
if err != nil {
t.Logf("Failed to accept connection: %s", err)
return
}
breader := bufio.NewReader(conn)
req, err := http.ReadRequest(breader)
if err != nil {
t.Logf("Failed to read request: %s", err)
return
}
if req.URL.Path != "/containers/c/stats" {
t.Logf("Wrong URL path for stats: %q", req.URL.Path)
return
}
received <- true
time.Sleep(time.Second)
}()
Expand Down

0 comments on commit 9aec3ae

Please sign in to comment.