fix flaky HTTP/3 request body test (#3447)

This commit is contained in:
Marten Seemann 2022-06-09 20:32:20 +02:00 committed by GitHub
parent 4c96cf75bf
commit 6fbc6d951a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -797,9 +797,11 @@ var _ = Describe("Client", func() {
<-done
return 0, errors.New("test done")
})
str.EXPECT().Close()
closed := make(chan struct{})
str.EXPECT().Close().Do(func() { close(closed) })
_, err := client.RoundTripOpt(req, RoundTripOpt{})
Expect(err).To(MatchError("test done"))
Eventually(closed).Should(BeClosed())
})
It("sets the Content-Length", func() {