Skip to content

Commit

Permalink
http3: fix another flaky Extended CONNECT test (#4539)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 29, 2024
1 parent 8a3d90f commit 82a3847
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions http3/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,12 @@ var _ = Describe("Client", func() {
It("checks the server's SETTINGS before sending an Extended CONNECT request", func() {
sendSettings()
done := make(chan struct{})
var wg sync.WaitGroup
wg.Add(2)
conn := mockquic.NewMockEarlyConnection(mockCtrl)
conn.EXPECT().OpenUniStream().DoAndReturn(func() (quic.SendStream, error) {
<-done
wg.Done()
return nil, errors.New("test done")
}).MaxTimes(1)
b := quicvarint.Append(nil, streamTypeControlStream)
Expand All @@ -397,6 +400,7 @@ var _ = Describe("Client", func() {
conn.EXPECT().AcceptUniStream(gomock.Any()).Return(controlStr, nil)
conn.EXPECT().AcceptUniStream(gomock.Any()).DoAndReturn(func(context.Context) (quic.ReceiveStream, error) {
<-done
wg.Done()
return nil, errors.New("test done")
})
conn.EXPECT().HandshakeComplete().Return(handshakeChan)
Expand All @@ -414,6 +418,7 @@ var _ = Describe("Client", func() {
// test shutdown
conn.EXPECT().CloseWithError(gomock.Any(), gomock.Any()).MaxTimes(1)
close(done)
wg.Wait()
})

It("rejects Extended CONNECT requests if the server doesn't enable it", func() {
Expand Down

0 comments on commit 82a3847

Please sign in to comment.