Keep streams from being set up after closeAllStreamReaders is called

Kubernetes-commit: 6c1a935da2df8e6ccf1ea6afcf51cb288f355356
This commit is contained in:
Jordan Liggitt
2024-02-29 15:31:55 -05:00
committed by Kubernetes Publisher
parent 36a771f98c
commit 27b1407865
2 changed files with 28 additions and 3 deletions

View File

@@ -1116,6 +1116,14 @@ func TestWebSocketClient_HeartbeatSucceeds(t *testing.T) {
wg.Wait()
}
func TestLateStreamCreation(t *testing.T) {
c := newWSStreamCreator(nil)
c.closeAllStreamReaders(nil)
if err := c.setStream(0, nil); err == nil {
t.Fatal("expected error adding stream after closeAllStreamReaders")
}
}
func TestWebSocketClient_StreamsAndExpectedErrors(t *testing.T) {
// Validate Stream functions.
c := newWSStreamCreator(nil)