def METHOD_NAME(self, worker, flag):
    # Do conditional check in here, as it seems to not work properly
    # inside a pytest.mark.skipIf
    if conf.OPTIONS["Database"]["DATABASE_ENGINE"] == "postgres":
        b = Worker(worker.storage.engine, regular_workers=1, high_workers=1)
        job = Job(toggle_flag, args=(flag.event_id,))
        worker.storage.enqueue_job(job, QUEUE)
        while job.state != State.COMPLETED:
            job = worker.storage.get_job(job.job_id)
            time.sleep(0.5)
        assert job.state == State.COMPLETED
        assert flag.is_set()
        b.shutdown()