@@ -73,15 +73,6 @@ protected HttpMetricsTestBase(ITestOutputHelper output) : base(output)
7373 }
7474
7575
76- private static void VerifyPeerAddress ( KeyValuePair < string , object ? > [ ] tags , IPAddress [ ] validPeerAddresses = null )
77- {
78- string ipString = ( string ) tags . Single ( t => t . Key == "network.peer.address" ) . Value ;
79- validPeerAddresses ??= [ IPAddress . Loopback . MapToIPv6 ( ) , IPAddress . Loopback , IPAddress . IPv6Loopback ] ;
80- IPAddress ip = IPAddress . Parse ( ipString ) ;
81- Assert . Contains ( ip , validPeerAddresses ) ;
82- }
83-
84-
8576 protected static void VerifyRequestDuration ( Measurement < double > measurement ,
8677 Uri uri ,
8778 Version ? protocolVersion = null ,
@@ -127,29 +118,23 @@ protected static void VerifyActiveRequests(string instrumentName, long measureme
127118 Assert . Equal ( method , tags . Single ( t => t . Key == "http.request.method" ) . Value ) ;
128119 }
129120
130- protected static void VerifyOpenConnections ( string actualName , object measurement , KeyValuePair < string , object ? > [ ] tags , long expectedValue , Uri uri , Version ? protocolVersion , string state , IPAddress [ ] validPeerAddresses = null )
121+ protected static void VerifyOpenConnections ( string actualName , object measurement , KeyValuePair < string , object ? > [ ] tags , long expectedValue , Uri uri , Version ? protocolVersion , string state )
131122 {
132123 Assert . Equal ( InstrumentNames . OpenConnections , actualName ) ;
133124 Assert . Equal ( expectedValue , Assert . IsType < long > ( measurement ) ) ;
134125 VerifySchemeHostPortTags ( tags , uri ) ;
135126 VerifyTag ( tags , "network.protocol.version" , GetVersionString ( protocolVersion ) ) ;
136127 VerifyTag ( tags , "http.connection.state" , state ) ;
137- VerifyPeerAddress ( tags , validPeerAddresses ) ;
138128 }
139129
140- protected static void VerifyConnectionDuration ( string instrumentName , object measurement , KeyValuePair < string , object ? > [ ] tags , Uri uri , Version ? protocolVersion , IPAddress [ ] validPeerAddresses = null )
130+ protected static void VerifyConnectionDuration ( string instrumentName , object measurement , KeyValuePair < string , object ? > [ ] tags , Uri uri , Version ? protocolVersion )
141131 {
142132 Assert . Equal ( InstrumentNames . ConnectionDuration , instrumentName ) ;
143133 double value = Assert . IsType < double > ( measurement ) ;
144134
145- // This flakes for remote requests on CI.
146- if ( validPeerAddresses is null )
147- {
148- Assert . InRange ( value , double . Epsilon , 60 ) ;
149- }
135+ Assert . InRange ( value , double . Epsilon , 60 ) ;
150136 VerifySchemeHostPortTags ( tags , uri ) ;
151137 VerifyTag ( tags , "network.protocol.version" , GetVersionString ( protocolVersion ) ) ;
152- VerifyPeerAddress ( tags , validPeerAddresses ) ;
153138 }
154139
155140 protected static void VerifyTimeInQueue ( string instrumentName , object measurement , KeyValuePair < string , object ? > [ ] tags , Uri uri , Version ? protocolVersion , string method = "GET" )
@@ -384,8 +369,6 @@ public async Task ExternalServer_DurationMetrics_Recorded()
384369 Uri uri = UseVersion == HttpVersion . Version11
385370 ? Test . Common . Configuration . Http . RemoteHttp11Server . EchoUri
386371 : Test . Common . Configuration . Http . RemoteHttp2Server . EchoUri ;
387- IPAddress [ ] addresses = await Dns . GetHostAddressesAsync ( uri . Host ) ;
388- addresses = addresses . Union ( addresses . Select ( a => a . MapToIPv6 ( ) ) ) . ToArray ( ) ;
389372
390373 using ( HttpMessageInvoker client = CreateHttpMessageInvoker ( ) )
391374 {
@@ -398,9 +381,9 @@ public async Task ExternalServer_DurationMetrics_Recorded()
398381
399382 VerifyRequestDuration ( Assert . Single ( requestDurationRecorder . GetMeasurements ( ) ) , uri , UseVersion , 200 , "GET" ) ;
400383 Measurement < double > cd = Assert . Single ( connectionDurationRecorder . GetMeasurements ( ) ) ;
401- VerifyConnectionDuration ( InstrumentNames . ConnectionDuration , cd . Value , cd . Tags . ToArray ( ) , uri , UseVersion , addresses ) ;
384+ VerifyConnectionDuration ( InstrumentNames . ConnectionDuration , cd . Value , cd . Tags . ToArray ( ) , uri , UseVersion ) ;
402385 Measurement < long > oc = openConnectionsRecorder . GetMeasurements ( ) . First ( ) ;
403- VerifyOpenConnections ( InstrumentNames . OpenConnections , oc . Value , oc . Tags . ToArray ( ) , 1 , uri , UseVersion , "idle" , addresses ) ;
386+ VerifyOpenConnections ( InstrumentNames . OpenConnections , oc . Value , oc . Tags . ToArray ( ) , 1 , uri , UseVersion , "idle" ) ;
404387 }
405388
406389 [ ConditionalFact ( typeof ( RemoteExecutor ) , nameof ( RemoteExecutor . IsSupported ) ) ]
0 commit comments