@@ -117,8 +117,13 @@ public void BasicTest_StartThrowsAbortCalledInFinally_AbortDoesntThrow()
117117 }
118118 }
119119
120- [ ConditionalFact ( nameof ( PlatformDetection ) + "." + nameof ( PlatformDetection . IsNotOneCoreUAP ) ) ]
121- public async Task UnknownHeaders_Success ( )
120+ [ ActiveIssue ( 19754 ) ] // Recombine into UnknownHeaders_Success when fixed
121+ [ ConditionalTheory ( nameof ( PlatformDetection ) + "." + nameof ( PlatformDetection . IsNotOneCoreUAP ) ) ]
122+ public Task UnknownHeaders_Success_Large ( ) => UnknownHeaders_Success ( 1000 ) ;
123+
124+ [ ConditionalTheory ( nameof ( PlatformDetection ) + "." + nameof ( PlatformDetection . IsNotOneCoreUAP ) ) ]
125+ [ InlineData ( 100 ) ]
126+ public async Task UnknownHeaders_Success ( int numHeaders )
122127 {
123128 Task < HttpListenerContext > server = _listener . GetContextAsync ( ) ;
124129
@@ -128,15 +133,22 @@ public async Task UnknownHeaders_Success()
128133
129134 HttpRequestMessage requestMessage = new HttpRequestMessage ( HttpMethod . Get , _factory . ListeningUrl ) ;
130135
131- for ( int i = 0 ; i < 1000 ; i ++ )
136+ for ( int i = 0 ; i < numHeaders ; i ++ )
132137 {
133138 requestMessage . Headers . Add ( $ "custom{ i } ", i . ToString ( ) ) ;
134139 }
135140
136141 Task < HttpResponseMessage > clientTask = client . SendAsync ( requestMessage ) ;
142+
143+ if ( clientTask == await Task . WhenAny ( server , clientTask ) )
144+ {
145+ ( await clientTask ) . EnsureSuccessStatusCode ( ) ;
146+ Assert . True ( false , "Client should not have completed prior to server sending response" ) ;
147+ }
148+
137149 HttpListenerContext context = await server ;
138150
139- for ( int i = 0 ; i < 1000 ; i ++ )
151+ for ( int i = 0 ; i < numHeaders ; i ++ )
140152 {
141153 Assert . Equal ( i . ToString ( ) , context . Request . Headers [ $ "custom{ i } "] ) ;
142154 }
@@ -151,4 +163,3 @@ public async Task UnknownHeaders_Success()
151163 }
152164 }
153165}
154-
0 commit comments