File tree 2 files changed +42
-0
lines changed
src/Tests/Nest.Tests.Integration
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 184
184
<Compile Include =" Mapping\GetMultipleMappingTests.cs" />
185
185
<Compile Include =" Reproduce\Reproduce1079Tests.cs" />
186
186
<Compile Include =" Reproduce\Reproduce1169Tests.cs" />
187
+ <Compile Include =" Reproduce\Reproduce1176Tests.cs" />
187
188
<Compile Include =" Reproduce\Reproduce769Tests.cs" />
188
189
<Compile Include =" Reproduce\Reproduce945Tests.cs" />
189
190
<Compile Include =" Reproduce\Reproduce953Tests.cs" />
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments