code: def test_monitor_jobs(tmp_path: Path) -> None:
      job: FakeJobWithTimer[int] = FakeJobWithTimer(
          job_id="failed", folder=tmp_path
      )
      job2: FakeJobWithTimer[int] = FakeJobWithTimer(
          job_id="succeeded", folder=tmp_path
      )
      jobs = [job, job2]
      helpers.monitor_jobs(jobs, 0.02, test_mode=True)
      assert all(j for j in jobs if j.done())
      assert set(j for j in jobs if j.state.upper() == "FAILED") == {
          job
      }
  
imports: import os
  import time
  import typing
  from pathlib import Path
  import pytest
  from .None import helpers
  from .core import core, utils
label_desc: Use image node_id 8 for calling a global function with example usage: test_monitor_jobs(tmp_path) without return types