Fix broken connection write optimizer test

This commit is contained in:
Matt Joiner 2014-06-26 17:30:54 +10:00
parent de769cdce7
commit b53e019a6f
1 changed files with 6 additions and 3 deletions

View File

@ -39,8 +39,11 @@ func TestCancelRequestOptimized(t *testing.T) {
}
}
close(c.post)
_, ok := <-c.write
if ok {
t.Fatal("write channel didn't close")
// Drain the write channel until it closes.
for b := range c.write {
bs := string(b)
if bs != "\x00\x00\x00\x00" {
t.Fatal("got unexpected non-keepalive")
}
}
}