#NEWLINE# @ async_test #NEWLINE# def testCreate( self ) : #NEWLINE# #INDENT# alloc = IdAllocator ( 'type' , 13 ) #NEWLINE# num_ids = 3000 #NEWLINE# def _OnAllocated( ids ) : #NEWLINE# #INDENT# id_set = set ( ids ) #NEWLINE# assert ( len ( id_set ) == num_ids ) #NEWLINE# self . stop ( ) #NEWLINE# #UNINDENT# with util . ArrayBarrier ( _OnAllocated ) as b : #NEWLINE# #INDENT# [ alloc . NextId ( num_ids . _client , callback = b . Callback ( ) ) for i in xrange ( num_ids ) ]