#NEWLINE# def testJobFileStoreWithSmallCache( self , retryCount = 0 , badWorker = 0.0 , stringNo = 1 , stringLength = 1000000 , cacheSize = 10000 , testNo = 2 ) : #NEWLINE# #INDENT# '\n        Creates a chain of jobs, each reading and writing files using the \n        Job.FileStore interface. Verifies the files written are always what we expect.\n        The chain tests the caching behavior. \n        ' #NEWLINE# for test in xrange ( testNo ) : #NEWLINE# #INDENT# def randomString( ) : #NEWLINE# #INDENT# chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' #NEWLINE# s = '' . join ( map ( ( lambda i : random . choice ( chars ) ) , xrange ( stringLength ) ) ) #NEWLINE# return ( s [ : PREFIX_LENGTH ] , s ) #NEWLINE# #UNINDENT# testStrings = dict ( map ( ( lambda i : randomString ( ) ) , xrange ( stringNo ) ) ) #NEWLINE# options = Job . Runner . getDefaultOptions ( self . _getTestJobStorePath ( ) ) #NEWLINE# options . logLevel = 'INFO' #NEWLINE# options . cacheSize = cacheSize #NEWLINE# options . retryCount = retryCount #NEWLINE# options . badWorker = badWorker #NEWLINE# options . badWorkerFailInterval = 1.0 #NEWLINE# chainLength = 10 #NEWLINE# Job . Runner . startToil ( Job . wrapJobFn ( fileTestJob , [ ] , testStrings , self ) , options )