def METHOD_NAME(queue, distributed_tracing_enabled, worker_service_name):
    token = "tests.contrib.rq.test_rq.test_enqueue_distributed_tracing_enabled_%s_worker_service_%s" % (
        distributed_tracing_enabled,
        worker_service_name,
    )
    num_traces_expected = None
    if not (sys.version_info.major == 3 and sys.version_info.minor == 5):
        num_traces_expected = 2 if distributed_tracing_enabled is False else 1
    with snapshot_context(token, ignores=snapshot_ignores, wait_for_num_traces=num_traces_expected):
        env = os.environ.copy()
        env["DD_TRACE_REDIS_ENABLED"] = "false"
        if distributed_tracing_enabled is not None:
            env["DD_RQ_DISTRIBUTED_TRACING_ENABLED"] = str(distributed_tracing_enabled)
        if worker_service_name is not None:
            env["DD_SERVICE"] = "custom-worker-service"
        p = subprocess.Popen(["ddtrace-run", "rq", "worker", "q"], env=env)
        try:
            job = queue.enqueue(job_add1, 1)
            # Wait for job to complete
            for _ in range(100):
                if job.result is not None:
                    break
                time.sleep(0.1)
            assert job.result == 2
        finally:
            p.terminate()
            # Wait for trace to be sent
            time.sleep(0.5)