Skip to content

Commit b8db99a

Browse files
committed
Add test in attempt to reproduce #1176
1 parent 5d5b337 commit b8db99a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

Diff for: src/Tests/Nest.Tests.Integration/Nest.Tests.Integration.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
<Compile Include="Mapping\GetMultipleMappingTests.cs" />
185185
<Compile Include="Reproduce\Reproduce1079Tests.cs" />
186186
<Compile Include="Reproduce\Reproduce1169Tests.cs" />
187+
<Compile Include="Reproduce\Reproduce1176Tests.cs" />
187188
<Compile Include="Reproduce\Reproduce769Tests.cs" />
188189
<Compile Include="Reproduce\Reproduce945Tests.cs" />
189190
<Compile Include="Reproduce\Reproduce953Tests.cs" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using Elasticsearch.Net.ConnectionPool;
2+
using Elasticsearch.Net.Exceptions;
3+
using FluentAssertions;
4+
using NUnit.Framework;
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
11+
namespace Nest.Tests.Integration.Reproduce
12+
{
13+
public class Reproduce1176Tests
14+
{
15+
[Test]
16+
public void MaxRetryExceptionInnerExceptionIsNull()
17+
{
18+
var nodes = new Uri[]
19+
{
20+
new Uri("http://localhost:9300"),
21+
new Uri("http://localhost:9400"),
22+
new Uri("http://localhost:9500")
23+
};
24+
var connectionPool = new StaticConnectionPool(nodes);
25+
var settings = new ConnectionSettings(connectionPool);
26+
var client = new ElasticClient(settings);
27+
28+
var maxRetryException = Assert.Throws<MaxRetryException>(() => client.GetIndex(g => g.Index("foo")));
29+
maxRetryException.InnerException.Should().NotBeNull();
30+
31+
var aggregateException = maxRetryException.InnerException as AggregateException;
32+
aggregateException.Should().NotBeNull();
33+
aggregateException.InnerExceptions.Count.Should().Be(3);
34+
35+
foreach(var innerException in aggregateException.InnerExceptions)
36+
{
37+
(innerException is PingException).Should().BeTrue();
38+
}
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)