#NEWLINE# def test_multiple_node_cluster_retry( self ) : #NEWLINE# #INDENT# cluster_size = 3 #NEWLINE# last_index = ( cluster_size * 2 ) #NEWLINE# retry_context = ClusterRetryContext ( cluster_size = cluster_size ) #NEWLINE# for i in range ( ( last_index + 1 ) ) : #NEWLINE# #INDENT# ( should_stop , wait ) = retry_context . test_should_stop ( ) #NEWLINE# if ( i == last_index ) : #NEWLINE# #INDENT# self . assertTrue ( should_stop , 'Done trying.' ) #NEWLINE# self . assertEqual ( wait , ( - 1 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertFalse ( should_stop , 'Not done trying.' ) #NEWLINE# if ( ( ( i + 1 ) % wait ) == 0 ) : #NEWLINE# #INDENT# self . assertEqual ( wait , 10 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( wait , 0 )