code: def test_demo_four_workers(tmp_path, storage, monkeypatch):
      """Test a simple usage scenario."""
      monkeypatch.chdir(os.path.dirname(os.path.abspath(__file__)))
  
      logdir = logging_directory()
      print(logdir)
  
      with generate_config(
          "orion_config_random.yaml", tmp_path
      ) as conf_file:
          processes = []
          for _ in range(4):
              process = subprocess.Popen(
                  [
                      "orion",
                      "-vvv",
                      "--logdir",
                      logdir,
                      "hunt",
                      "--working-dir",
                      str(tmp_path),
                      "-n",
                      "four_workers_demo",
                      "--config",
                      f"{conf_file.name}",
                      "--max-trials",
                      "20",
                      "./black_box.py",
                      "-x~norm(34, 3)",
                  ],
                  stdout=subprocess.PIPE,
                  stderr=subprocess.STDOUT,
              )
              processes.append(process)
  
          for process in processes:
              stdout, _ = process.communicate()
  
              rcode = process.wait()
  
              if rcode != 0:
                  print("OUT", stdout.decode("utf-8"))
  
              assert rcode == 0
  
      assert storage._db.host == orion.core.config.storage.database.host
      print(storage._db.host)
  
      exp = list(
          storage.fetch_experiments({"name": "four_workers_demo"})
      )
      assert len(exp) == 1
      exp = exp[0]
      assert "_id" in exp
      exp_id = exp["_id"]
      assert exp["name"] == "four_workers_demo"
      assert exp["max_trials"] == 20
      assert exp["max_broken"] == 5
      assert exp["algorithm"] == {"random": {"seed": 2}}
      assert "user" in exp["metadata"]
      assert "datetime" in exp["metadata"]
      assert "orion_version" in exp["metadata"]
      assert "user_script" in exp["metadata"]
      assert exp["metadata"]["user_args"] == [
          "./black_box.py",
          "-x~norm(34, 3)",
      ]
  
      trials = list(storage.fetch_trials(uid=exp_id))
      status = defaultdict(int)
      for trial in trials:
          status[trial.status] += 1
      assert status["completed"] >= 20
      assert status["new"] < 5
      params = trials[-1].params
      assert len(params) == 1
      px = params["/x"]
      assert isinstance(px, float)
  
imports: import os
  import shutil
  import subprocess
  import sys
  import tempfile
  from collections import defaultdict
  from contextlib import contextmanager
  import numpy
  import pytest
  import yaml
  import orion.core.cli
  import orion.core.io.experiment_builder
  from orion.core.cli.hunt import workon
  from orion.testing import OrionState
label_desc: Use image node_id 9 for calling a global function with example usage: test_demo_four_workers(tmp_path, storage, monkeypatch) without return types