polish the newly added transport test

This commit is contained in:
iamqizhao 2015-07-29 11:15:58 -07:00
Родитель 310d7f91d8
Коммит 4179d89d53
1 изменённых файлов: 7 добавлений и 15 удалений

Просмотреть файл

@ -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.
ct.CloseStream(s, nil)
for {
select {
case <-ch:
case <-done:
t.Fatalf("Client has not received the max stream setting in 5 seconds.")
select {
case i:=<-cc.streamsQuota.acquire():
if i != 1 {
t.Fatalf("streamsQuota.acquire() got %d quota, want 1.", i)
}
select {
case i:=<-cc.streamsQuota.acquire():
if i != 1 {
t.Fatalf("fadfa")
}
cc.streamsQuota.add(i)
default:
t.Fatalf("43092")
}
break
cc.streamsQuota.add(i)
default:
t.Fatalf("streamsQuota.acquire() is not readable.")
}
if _, err := ct.NewStream(context.Background(), callHdr); err != nil {
t.Fatalf("failed to open stream: %v", err)