def test_sampled_get_next_task_status(self):
        task = self.tasks['awaiting_processing']
        step = task.step
        step.review_policy = {'policy': 'sampled_review',
                              'rate': 0.5,
                              'max_reviews': 1}
        step.save()
        task.status = Task.Status.PROCESSING
        complete_count = 0
        for i in range(0, 1000):
            next_status = get_next_task_status(
                task, Iteration.Status.REQUESTED_REVIEW)
            complete_count += next_status == Task.Status.COMPLETE
        self.assertTrue(complete_count > 400)
        self.assertTrue(complete_count < 600)
dataset/ETHPy150Open unlimitedlabs/orchestra/orchestra/tests/test_task_lifecycle.py/BasicTaskLifeCycleTestCase.test_sampled_get_next_task_status/original