def testEvaluatingRandomDAG(self):
        """
        Randomly generate test input then check that the ordering of the running
        respected the constraints.
        """
        jobStore = self._getTestJobStorePath()
        for test in xrange(30):
            # Temporary file
            tempDir = self._createTempDir(purpose='tempDir')
            # Make a random DAG for the set of child edges
            nodeNumber = random.choice(xrange(2, 20))
            childEdges = self.makeRandomDAG(nodeNumber)
            # Get an adjacency list representation and check is acyclic
            adjacencyList = self.getAdjacencyList(nodeNumber, childEdges)
            self.assertTrue(self.isAcyclic(adjacencyList))
            # Add in follow on edges - these are returned as a list, and as a set
            # of augmented edges in the adjacency list
            followOnEdges = self.addRandomFollowOnEdges(adjacencyList)
            self.assertTrue(self.isAcyclic(adjacencyList))
            # Make the job graph
            rootJob = self.makeJobGraph(nodeNumber, childEdges, followOnEdges, tempDir)
            # Run the job  graph
            options = Job.Runner.getDefaultOptions("%s.%i" % (jobStore, test))
            options.retryCount = 100
            options.badWorker=0.5
            options.badWorkerFailInterval = 0.01
            #options.logLevel = "DEBUG"
            Job.Runner.startToil(rootJob, options)
            # For each job check it created a valid output file
            # and add the ordering relationships contained within the output
            # file to the ordering relationship, so we can check they are compatible
            # with the relationships defined by the job DAG.
            for i in xrange(nodeNumber):
                with open(os.path.join(tempDir, str(i)), 'r') as fH:
                    ordering = map(int, fH.readline().split())
                    self.assertEquals(int(ordering[-1]), i)
                    for j in ordering[:-1]:
                        adjacencyList[int(j)].add(int(ordering[-1]))
            # Check the ordering retains an acyclic graph
            if not self.isAcyclic(adjacencyList):
                print "ORDERING", ordering
                print "CHILD EDGES", childEdges
                print "FOLLOW ON EDGES", followOnEdges
                print "ADJACENCY LIST", adjacencyList
            self.assertTrue(self.isAcyclic(adjacencyList))
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/test/src/jobTest.py/JobTest.testEvaluatingRandomDAG/original