#NEWLINE# def randomSplitComputationTest( self , text ) : #NEWLINE# #INDENT# if isinstance ( text , str ) : #NEWLINE# #INDENT# funImplVal = FORA . extractImplValContainer ( FORA . eval ( text ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# funImplVal = text #NEWLINE# #UNINDENT# unsplitVal = callAndGetResult ( funImplVal ) #NEWLINE# splitAtLeastOne = False #NEWLINE# i = 0 #NEWLINE# while ( i < 3000 ) : #NEWLINE# #INDENT# i += 1 #NEWLINE# try : #NEWLINE# #INDENT# pausedComputation = callAndExtractPausedCompuationAfterSteps ( funImplVal , i ) #NEWLINE# #UNINDENT# except NotInterruptedException as e : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# splitComputation = ForaNative . splitPausedComputation ( pausedComputation ) #NEWLINE# unsplitVal2 = finishPausedComputation ( pausedComputation ) #NEWLINE# self . assertEqual ( unsplitVal , unsplitVal2 ) #NEWLINE# if splitComputation : #NEWLINE# #INDENT# splitAtLeastOne = True #NEWLINE# applyComputationVal = finishPausedComputation ( splitComputation . applyComputation ) #NEWLINE# splitComputationVal = finishPausedComputation ( splitComputation . splitComputation ) #NEWLINE# resumedComputation = ForaNative . joinSplitPausedComputation ( splitComputation , applyComputationVal , splitComputationVal ) #NEWLINE# finalSplitVal = finishPausedComputation ( resumedComputation ) #NEWLINE# self . assertEqual ( unsplitVal , finalSplitVal ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not splitAtLeastOne ) : #NEWLINE# #INDENT# logging . warn ( ( "didn't split any versions of `%s`\nafter i = %s tries" % ( text , i ) ) )