File tree 3 files changed +28
-3
lines changed
3 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 1
1
<Project >
2
2
<!-- VersionPrefix property for builds and packages -->
3
3
<PropertyGroup >
4
- <VersionPrefix >1.0.62 </VersionPrefix >
4
+ <VersionPrefix >1.0.63 </VersionPrefix >
5
5
</PropertyGroup >
6
6
</Project >
Original file line number Diff line number Diff line change @@ -294,7 +294,7 @@ public IPEndPoint GetClusterEndpoint()
294
294
{
295
295
socket . Connect ( "8.8.8.8" , 65530 ) ;
296
296
var endPoint = socket . LocalEndPoint as IPEndPoint ;
297
- return endPoint ;
297
+ return new IPEndPoint ( endPoint . Address , localEndPoint . Port ) ;
298
298
}
299
299
}
300
300
else if ( localEndPoint . Address . Equals ( IPAddress . IPv6Any ) )
@@ -303,7 +303,7 @@ public IPEndPoint GetClusterEndpoint()
303
303
{
304
304
socket . Connect ( "2001:4860:4860::8888" , 65530 ) ;
305
305
var endPoint = socket . LocalEndPoint as IPEndPoint ;
306
- return endPoint ;
306
+ return new IPEndPoint ( endPoint . Address , localEndPoint . Port ) ;
307
307
}
308
308
}
309
309
return localEndPoint ;
Original file line number Diff line number Diff line change @@ -135,5 +135,30 @@ public void ClusterAnnounceRecoverTest()
135
135
ClassicAssert . AreEqual ( clusterAnnounceEndpoint . Address . ToString ( ) , clusterNodesEndpoint . Address . ToString ( ) ) ;
136
136
ClassicAssert . AreEqual ( clusterAnnounceEndpoint . Port , clusterNodesEndpoint . Port ) ;
137
137
}
138
+
139
+ [ Test , Order ( 3 ) ]
140
+ [ Category ( "CLUSTER-CONFIG" ) , CancelAfter ( 1000 ) ]
141
+ public void ClusterAnyIPAnnounce ( )
142
+ {
143
+ context . nodes = new GarnetServer [ 1 ] ;
144
+ context . nodes [ 0 ] = context . CreateInstance ( new IPEndPoint ( IPAddress . Any , 7000 ) ) ;
145
+ context . nodes [ 0 ] . Start ( ) ;
146
+
147
+ context . endpoints = TestUtils . GetShardEndPoints ( 1 , IPAddress . Loopback , 7000 ) ;
148
+ context . CreateConnection ( ) ;
149
+
150
+ var config = context . clusterTestUtils . ClusterNodes ( 0 , logger : context . logger ) ;
151
+ var origin = config . Origin ;
152
+
153
+ var endpoint = origin . ToIPEndPoint ( ) ;
154
+ ClassicAssert . AreEqual ( 7000 , endpoint . Port ) ;
155
+
156
+ using var client = TestUtils . GetGarnetClient ( config . Origin ) ;
157
+ client . Connect ( ) ;
158
+ var resp = client . PingAsync ( ) . GetAwaiter ( ) . GetResult ( ) ;
159
+ ClassicAssert . AreEqual ( "PONG" , resp ) ;
160
+ resp = client . QuitAsync ( ) . GetAwaiter ( ) . GetResult ( ) ;
161
+ ClassicAssert . AreEqual ( "OK" , resp ) ;
162
+ }
138
163
}
139
164
}
You can’t perform that action at this time.
0 commit comments