def METHOD_NAME(self, dispatcher):
    task = DummyTask()
    scheduler, thread = self.create_and_start(dispatcher)
    t = time.time()
    scheduler.schedule(task, args=("task2",), start=t + 1)  # task two gets scheduled first
    time.sleep(0.25)
    scheduler.schedule(
        task, args=("task1",), start=t + 0.5
    )  # but task one has the shorter deadline
    scheduler.schedule(scheduler.close, start=t + 1.5)
    thread.join(5)
    assert len(task.invocations) == 2
    assert task.invocations[0][2][0] == "task1"
    assert task.invocations[1][2][0] == "task2"