#NEWLINE# def test_lost_coordinator_connection( self ) : #NEWLINE# #INDENT# internal_bad_host = self . cluster . internal_slaves [ 0 ] #NEWLINE# bad_host = self . cluster . slaves [ 0 ] #NEWLINE# good_hosts = [ self . cluster . internal_master , self . cluster . internal_slaves [ 1 ] , self . cluster . internal_slaves [ 2 ] ] #NEWLINE# topology = { #NEWLINE# #INDENT# 'coordinator' : internal_bad_host , #NEWLINE# 'workers' : good_hosts , #NEWLINE# #UNINDENT# } #NEWLINE# self . upload_topology ( topology ) #NEWLINE# self . cluster . stop_host ( bad_host ) #NEWLINE# output = self . run_prestoadmin ( 'configuration deploy' , raise_error = False ) #NEWLINE# self . assertRegexpMatches ( output , self . down_node_connection_error ( internal_bad_host ) ) #NEWLINE# for host in self . cluster . all_internal_hosts ( ) : #NEWLINE# #INDENT# self . assertTrue ( ( ( 'Deploying configuration on: %s' % host ) in output ) ) #NEWLINE# #UNINDENT# expected_size = ( self . len_down_node_error + len ( self . cluster . all_hosts ( ) ) ) #NEWLINE# self . assertEqual ( len ( output . splitlines ( ) ) , expected_size ) #NEWLINE# output = self . run_prestoadmin ( 'configuration show config' , raise_error = False ) #NEWLINE# self . assertRegexpMatches ( output , self . down_node_connection_error ( internal_bad_host ) ) #NEWLINE# with open ( os . path . join ( LOCAL_RESOURCES_DIR , 'configuration_show_down_node.txt' ) , 'r' ) as f : #NEWLINE# #INDENT# expected = f . read ( ) #NEWLINE# #UNINDENT# self . assertRegexpMatches ( str . join ( '\n' , output . splitlines ( ) [ 6 : ] ) , expected )