code: def test_client_run_creation_and_termination_are_successful():
      experiment_name = "test_run_creation_termination"
      MlflowClient().create_experiment(experiment_name)
      experiment_id = (
          MlflowClient()
          .get_experiment_by_name(experiment_name)
          .experiment_id
      )
  
      client = MlflowAutologgingQueueingClient()
      pending_run_id = client.create_run(
          experiment_id=experiment_id, start_time=5, tags={"a": "b"}
      )
      client.set_terminated(
          run_id=pending_run_id, status="FINISHED", end_time=6
      )
      client.flush()
  
      runs = mlflow.search_runs(
          experiment_ids=[experiment_id], output_format="list"
      )
      assert len(runs) == 1
      run = runs[0]
      assert run.info.start_time == 5
      assert run.info.end_time == 6
      assert run.info.status == "FINISHED"
      assert {"a": "b"}.items() <= run.data.tags.items()
  
imports: import time
  from unittest import mock
  import pytest
  import mlflow
  from mlflow import MlflowClient
  from mlflow.exceptions import MlflowException
  from mlflow.utils import _truncate_dict
  from mlflow.utils.autologging_utils import MlflowAutologgingQueueingClient
  from mlflow.utils.validation import MAX_ENTITY_KEY_LENGTH, MAX_METRICS_PER_BATCH, MAX_PARAM_VAL_LENGTH, MAX_PARAMS_TAGS_PER_BATCH, MAX_TAG_VAL_LENGTH
label_desc: Use image node_id 7 for calling a global function with example usage: test_client_run_creation_and_termination_are_successful() without return types