'Execution failures recorded for a query result in exponential backoff
for scheduling future execution.'

def test_failure_extends_schedule(self):

    query = self.factory.create_query(schedule='60', schedule_failures=4)
    retrieved_at = (utcnow() - datetime.timedelta(minutes=16))
    query_result = self.factory.create_query_result(retrieved_at=retrieved_at, query_text=query.query_text, query_hash=query.query_hash)
    query.latest_query_data = query_result
    self.assertEqual(list(models.Query.outdated_queries()), [])
    query_result.retrieved_at = (utcnow() - datetime.timedelta(minutes=17))
    self.assertEqual(list(models.Query.outdated_queries()), [query])
