@@ -120,71 +120,6 @@ await audit.TraceCalls(
120120 ) ;
121121 }
122122
123- [ U ( Skip = "Not sure how to trace this chain" ) , SuppressMessage ( "AsyncUsage" , "AsyncFixer001:Unnecessary async/await usage" , Justification = "Its a test" ) ]
124- public async Task FallsOverDeadNodesWithRecoverResetToPrimary ( )
125- {
126- /** A cluster with 2 nodes where the second node fails on ping */
127- var audit = new Auditor ( ( ) => Framework . Cluster
128- . Nodes ( 3 )
129- . ClientCalls ( p => p . OnPort ( 9200 ) . Fails ( Twice ) )
130- . ClientCalls ( p => p . OnPort ( 9200 ) . Succeeds ( Once ) )
131- . ClientCalls ( p => p . OnPort ( 9201 ) . Succeeds ( Once ) )
132- . ClientCalls ( p => p . OnPort ( 9201 ) . Fails ( Once ) )
133- . ClientCalls ( p => p . OnPort ( 9202 ) . FailAlways ( ) )
134- . StickyConnectionPool ( )
135- . Settings ( p => p . DisablePing ( ) )
136- ) ;
137-
138- await audit . TraceCalls (
139- /** The first call goes to 9200 which fails, so we wrap to 9201 */
140- new ClientCall {
141- { BadResponse , 9200 } ,
142- { HealthyResponse , 9201 } ,
143- { pool => pool . Nodes . Where ( n=> ! n . IsAlive ) . Should ( ) . HaveCount ( 1 ) }
144- } ,
145- /** The 2nd call does a ping on 9201 which is healthy */
146- new ClientCall {
147- { HealthyResponse , 9201 } ,
148- /** Finally we assert that the connectionpool has one node that is marked as dead */
149- { pool => pool . Nodes . Where ( n=> ! n . IsAlive ) . Should ( ) . HaveCount ( 1 ) }
150- } ,
151- /** The 3rd call does a ping on 9201 which fails, then 9202 and 9203 as all fail */
152- new ClientCall {
153- { BadResponse , 9201 } ,
154- { BadResponse , 9202 } ,
155- { MaxRetriesReached } ,
156- { pool => pool . Nodes . Where ( n=> ! n . IsAlive ) . Should ( ) . HaveCount ( 4 ) }
157- } ,
158- /** Try to resurrect first node 9200, which fails */
159- new ClientCall {
160- { AllNodesDead } ,
161- { Resurrection , 9200 } ,
162- { BadResponse , 9200 } ,
163- { pool => pool . Nodes . Where ( n=> ! n . IsAlive ) . Should ( ) . HaveCount ( 4 ) }
164- } ,
165- /** Try to ressurect second node 9201 which succeeds */
166- new ClientCall {
167- { AllNodesDead } ,
168- { Resurrection , 9201 } ,
169- { HealthyResponse , 9201 } ,
170- { pool => pool . Nodes . Where ( n=> ! n . IsAlive ) . Should ( ) . HaveCount ( 3 ) }
171- } ,
172- /** The ping on 9201 which returns a bad response leaving all nodes dead */
173- new ClientCall {
174- { BadResponse , 9201 } ,
175- { MaxRetriesReached } ,
176- { pool => pool . Nodes . Where ( n=> ! n . IsAlive ) . Should ( ) . HaveCount ( 4 ) }
177- } ,
178- /** Try ressurect from 9201 again which succeeded */
179- new ClientCall {
180- { AllNodesDead } ,
181- { Resurrection , 9200 } ,
182- { HealthyResponse , 9200 } ,
183- { pool => pool . Nodes . Where ( n=> ! n . IsAlive ) . Should ( ) . HaveCount ( 3 ) }
184- }
185- ) ;
186- }
187-
188123 [ U , SuppressMessage ( "AsyncUsage" , "AsyncFixer001:Unnecessary async/await usage" , Justification = "Its a test" ) ]
189124 public async Task PicksADifferentNodeEachTimeAnodeIsDown ( )
190125 {
0 commit comments