From: Matt Joiner Date: Thu, 26 Jun 2014 07:30:54 +0000 (+1000) Subject: Fix broken connection write optimizer test X-Git-Tag: v1.0.0~1707 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b53e019a6fe56703fb86dd2391930ee886b858a3;p=btrtrc.git Fix broken connection write optimizer test --- diff --git a/connection_test.go b/connection_test.go index 9374a66d..280afe9f 100644 --- a/connection_test.go +++ b/connection_test.go @@ -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") + } } }