def test_priority(instance, grpc_server_registry):
    create_run(instance, run_id='default-pri-run', status=PipelineRunStatus.QUEUED)
    create_run(instance, run_id='low-pri-run', status=PipelineRunStatus.QUEUED, tags={PRIORITY_TAG: '-1'})
    create_run(instance, run_id='hi-pri-run', status=PipelineRunStatus.QUEUED, tags={PRIORITY_TAG: '3'})
    coordinator = QueuedRunCoordinatorDaemon(interval_seconds=5, max_concurrent_runs=10)
    list(coordinator.run_iteration(instance, grpc_server_registry))
    assert (get_run_ids(instance.run_launcher.queue()) == ['hi-pri-run', 'default-pri-run', 'low-pri-run'])
def test_priority(instance, grpc_server_registry):
    create_run(instance, run_id='default-pri-run', status=PipelineRunStatus.QUEUED)
    create_run(instance, run_id='low-pri-run', status=PipelineRunStatus.QUEUED, tags={PRIORITY_TAG: '-1'})
    create_run(instance, run_id='hi-pri-run', status=PipelineRunStatus.QUEUED, tags={PRIORITY_TAG: '3'})
    coordinator = QueuedRunCoordinatorDaemon(interval_seconds=5, max_concurrent_runs=10)
    list(coordinator.run_iteration(instance, grpc_server_registry))
    assert (get_run_ids(instance.run_launcher.queue()) == ['hi-pri-run', 'default-pri-run', 'low-pri-run'])