polish the newly added transport test

This commit is contained in:
iamqizhao
2015-07-29 11:15:58 -07:00
parent 310d7f91d8
commit 4179d89d53

View File

@ -408,22 +408,14 @@ func TestMaxStreams(t *testing.T) {
} }
// Close the pending stream so that the streams quota becomes available for the next new stream. // Close the pending stream so that the streams quota becomes available for the next new stream.
ct.CloseStream(s, nil) ct.CloseStream(s, nil)
for { select {
select { case i:=<-cc.streamsQuota.acquire():
case <-ch: if i != 1 {
case <-done: t.Fatalf("streamsQuota.acquire() got %d quota, want 1.", i)
t.Fatalf("Client has not received the max stream setting in 5 seconds.")
} }
select { cc.streamsQuota.add(i)
case i:=<-cc.streamsQuota.acquire(): default:
if i != 1 { t.Fatalf("streamsQuota.acquire() is not readable.")
t.Fatalf("fadfa")
}
cc.streamsQuota.add(i)
default:
t.Fatalf("43092")
}
break
} }
if _, err := ct.NewStream(context.Background(), callHdr); err != nil { if _, err := ct.NewStream(context.Background(), callHdr); err != nil {
t.Fatalf("failed to open stream: %v", err) t.Fatalf("failed to open stream: %v", err)