#NEWLINE# def serviceRoads( stacks , duration = 1.0 ) : #NEWLINE# #INDENT# '\n    Utility method to service queues for list of stacks. Call from test method.\n    ' #NEWLINE# start = time . time ( ) #NEWLINE# while ( ( start + duration ) > time . time ( ) ) : #NEWLINE# #INDENT# for stack in stacks : #NEWLINE# #INDENT# stack . serviceAll ( ) #NEWLINE# #UNINDENT# if all ( [ ( not stack . transactions ) for stack in stacks ] ) : #NEWLINE# #INDENT# console . terse ( 'Service stacks done normally\n' ) #NEWLINE# break #NEWLINE# #UNINDENT# time . sleep ( 0.05 ) #NEWLINE# #UNINDENT# for stack in stack : #NEWLINE# #INDENT# console . terse ( 'Stack {0} remotes: {1}\n' . format ( stack . name , stack . nameRemotes ) ) #NEWLINE# #UNINDENT# console . terse ( 'Service stacks exit\n' )