File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/Servers/Kestrel/test/InMemory.FunctionalTests Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -604,12 +604,17 @@ public async Task TraceIdentifierIsUnique()
604604 var usedIds = new ConcurrentBag < string > ( ) ;
605605
606606 // requests on separate connections in parallel
607- Parallel . For ( 0 , iterations , async i =>
607+ var tasks = new List < Task > ( iterations ) ;
608+ for ( var i = 0 ; i < iterations ; i ++ )
608609 {
609- var id = await server . HttpClientSlim . GetStringAsync ( $ "http://localhost:{ server . Port } /") ;
610- Assert . DoesNotContain ( id , usedIds . ToArray ( ) ) ;
611- usedIds . Add ( id ) ;
612- } ) ;
610+ tasks . Add ( Task . Run ( async ( ) =>
611+ {
612+ var id = await server . HttpClientSlim . GetStringAsync ( $ "http://localhost:{ server . Port } /") ;
613+ Assert . DoesNotContain ( id , usedIds . ToArray ( ) ) ;
614+ usedIds . Add ( id ) ;
615+ } ) ) ;
616+ }
617+ await Task . WhenAll ( tasks ) ;
613618
614619 // requests on same connection
615620 using ( var connection = server . CreateConnection ( ) )
You can’t perform that action at this time.
0 commit comments