#NEWLINE# def disabled_test_collect_threads( self ) : #NEWLINE# #INDENT# start = time . time ( ) #NEWLINE# def a( end ) : #NEWLINE# #INDENT# while ( time . time ( ) < end ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# def thread1_func( ) : #NEWLINE# #INDENT# a ( ( time . time ( ) + 0.2 ) ) #NEWLINE# #UNINDENT# def thread2_func( ) : #NEWLINE# #INDENT# a ( ( time . time ( ) + 0.3 ) ) #NEWLINE# #UNINDENT# collector = Collector ( interval = 0.01 , mode = 'prof' ) #NEWLINE# collector . start ( ) #NEWLINE# thread1 = threading . Thread ( target = thread1_func ) #NEWLINE# thread2 = threading . Thread ( target = thread2_func ) #NEWLINE# thread1 . start ( ) #NEWLINE# thread2 . start ( ) #NEWLINE# a ( ( time . time ( ) + 0.1 ) ) #NEWLINE# while thread1 . isAlive ( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# while thread2 . isAlive ( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# thread1 . join ( ) #NEWLINE# thread2 . join ( ) #NEWLINE# end = time . time ( ) #NEWLINE# collector . stop ( ) #NEWLINE# elapsed = ( end - start ) #NEWLINE# self . assertTrue ( ( 0.3 < expected < 0.4 ) , elapsed ) #NEWLINE# counts = self . filter_stacks ( collector ) #NEWLINE# expected = { #NEWLINE# #INDENT# ( 'a' , 'test_collect_threads' ) : 10 , #NEWLINE# ( 'a' , 'thread1_func' ) : 20 , #NEWLINE# ( 'a' , 'thread2_func' ) : 30 , #NEWLINE# #UNINDENT# } #NEWLINE# self . check_counts ( counts , expected )