def test_tag_limits(instance, grpc_server_registry):
    create_run(instance, run_id='tiny-1', status=PipelineRunStatus.QUEUED, tags={'database': 'tiny'})
    create_run(instance, run_id='tiny-2', status=PipelineRunStatus.QUEUED, tags={'database': 'tiny'})
    create_run(instance, run_id='large-1', status=PipelineRunStatus.QUEUED, tags={'database': 'large'})
    coordinator = QueuedRunCoordinatorDaemon(interval_seconds=5, max_concurrent_runs=10, tag_concurrency_limits=[{'key': 'database', 'value': 'tiny', 'limit': 1}])
    list(coordinator.run_iteration(instance, grpc_server_registry))
    assert (get_run_ids(instance.run_launcher.queue()) == ['tiny-1', 'large-1'])
def test_tag_limits(instance, grpc_server_registry):
    create_run(instance, run_id='tiny-1', status=PipelineRunStatus.QUEUED, tags={'database': 'tiny'})
    create_run(instance, run_id='tiny-2', status=PipelineRunStatus.QUEUED, tags={'database': 'tiny'})
    create_run(instance, run_id='large-1', status=PipelineRunStatus.QUEUED, tags={'database': 'large'})
    coordinator = QueuedRunCoordinatorDaemon(interval_seconds=5, max_concurrent_runs=10, tag_concurrency_limits=[{'key': 'database', 'value': 'tiny', 'limit': 1}])
    list(coordinator.run_iteration(instance, grpc_server_registry))
    assert (get_run_ids(instance.run_launcher.queue()) == ['tiny-1', 'large-1'])