diff --git a/io/flushing_writer_test.go b/io/flushing_writer_test.go
index <HASH>..<HASH> 100644
--- a/io/flushing_writer_test.go
+++ b/io/flushing_writer_test.go
@@ -13,6 +13,7 @@ import (
 	"net"
 	"net/http"
 	"net/http/httptest"
+	"sync"
 	"time"
 
 	check "gopkg.in/check.v1"
@@ -166,3 +167,24 @@ func (h *hijacker) Hijack() (net.Conn, *bufio.ReadWriter, error) {
 	}
 	return h.conn, &rw, nil
 }
+
+func (s *S) TestFlushingWriterFlushAfterWrite(c *check.C) {
+	wg := sync.WaitGroup{}
+	srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		flusher, ok := w.(WriterFlusher)
+		c.Assert(ok, check.Equals, true)
+		fw := FlushingWriter{WriterFlusher: flusher}
+		defer fw.Flush()
+		for i := 0; i < 100; i++ {
+			wg.Add(1)
+			go func() {
+				defer wg.Done()
+				fw.Write([]byte("a"))
+			}()
+		}
+	}))
+	defer srv.Close()
+	_, err := http.Get(srv.URL)
+	c.Assert(err, check.IsNil)
+	wg.Wait()
+}
io: add test to expose panic in write after close with flushing writer