File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
pkg/remote/trans/nphttp2/grpc Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,11 @@ github_checks:
3
3
4
4
ignore :
5
5
- " tool/**/*.go"
6
+
7
+ coverage :
8
+ status :
9
+ project :
10
+ default :
11
+ # pass if coverage drops by no more than 0.05%
12
+ # this is possibly caused by unstable coverage.
13
+ threshold : 0.05%
Original file line number Diff line number Diff line change @@ -1033,6 +1033,27 @@ func TestMaxStreams(t *testing.T) {
1033
1033
t .Fatalf ("%s" , "Test failed: didn't expect new stream to be created just yet." )
1034
1034
default :
1035
1035
}
1036
+ blocked := make (chan struct {})
1037
+ go func () {
1038
+ for {
1039
+ ok , _ := ct .controlBuf .execute (func (it interface {}) bool {
1040
+ // The last stream that fails with context deadline exceeded makes waitingStreams +1.
1041
+ // To make sure that the new stream is blocking because of streamQuota, we need to make sure that
1042
+ // streamQuota is 0 and waitingStreams is greater than 1
1043
+ if ct .streamQuota == 0 && ct .waitingStreams > 1 {
1044
+ return true
1045
+ }
1046
+ return false
1047
+ }, nil )
1048
+ if ok {
1049
+ close (blocked )
1050
+ return
1051
+ }
1052
+ time .Sleep (100 * time .Millisecond )
1053
+ }
1054
+ }()
1055
+ // wait for creating the new stream is blocking actually
1056
+ <- blocked
1036
1057
// Close the first stream created so that the new stream can finally be created.
1037
1058
ct .CloseStream (s , nil )
1038
1059
<- done
You can’t perform that action at this time.
0 commit comments