'Verifies that the scheduler run duration limit is followed.'

def test_scheduler_run_duration(self):

    dag_id = u'test_start_date_scheduling'
    dag = self.dagbag.get_dag(dag_id)
    dag.clear()
    self.assertTrue((dag.start_date > DEFAULT_DATE))
    expected_run_duration = 5
    start_time = datetime.datetime.now()
    scheduler = SchedulerJob(dag_id, run_duration=expected_run_duration, **self.default_scheduler_args)
    scheduler.run()
    end_time = datetime.datetime.now()
    run_duration = (end_time - start_time).total_seconds()
    logging.info(u'Test    ran    in    %.2fs,    expected    %.2fs', run_duration, expected_run_duration)
    self.assertLess((run_duration - expected_run_duration), 5.0)
