Skip to content

Commit de5d2a4

Browse files
committed
fix one test broke a bunch of others, fqdn injection in the virtualconnection now stable
1 parent 793339d commit de5d2a4

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Tests/Framework/VirtualClustering/MockResponses/SniffingResponse.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ private static IDictionary<string, object> SniffResponseNodes(IEnumerable<Node>
3333
private static Random Random = new Random(1337);
3434
private static object CreateNodeResponse(Node node, string name, string publishAddressOverride, bool randomFqdn)
3535
{
36-
var fqdn = randomFqdn ? $"fqdn{node.Uri.Port}/" : "";
37-
var publishAddress = !string.IsNullOrWhiteSpace(publishAddressOverride) ? publishAddressOverride : "127.0.0.1";
38-
publishAddress += ":" + node.Uri.Port;
36+
var port = node.Uri.Port;
37+
var fqdn = randomFqdn ? $"fqdn{port}/" : "";
38+
var host = !string.IsNullOrWhiteSpace(publishAddressOverride) ? publishAddressOverride : "127.0.0.1";
3939

4040
var nodeResponse = new
4141
{
4242
name = name,
43-
transport_address = $"127.0.0.1:{node.Uri.Port + 1000}]",
43+
transport_address = $"127.0.0.1:{port + 1000}]",
4444
host = Guid.NewGuid().ToString("N").Substring(0, 8),
4545
ip = "127.0.0.1",
4646
version = TestClient.Configuration.ElasticsearchVersion.Version,
@@ -49,11 +49,11 @@ private static object CreateNodeResponse(Node node, string name, string publishA
4949
http = node.HttpEnabled ? new
5050
{
5151
bound_address = new []
52-
5352
{
54-
$"{fqdn}127.0.0.1:{node.Uri.Port}"
53+
$"{fqdn}127.0.0.1:{port}"
5554
},
56-
publish_address = $"{fqdn}${publishAddress}"
55+
//publish_address = $"{fqdn}${publishAddress}"
56+
publish_address = $"{fqdn}{host}:{port}"
5757
} : null,
5858
settings = new Dictionary<string, object>
5959
{

0 commit comments

Comments
 (0)