docstr: Starts prepare_sync running in the background.
  
  Don't call this directly; use the `prepare` fixture instead, to ensure that
  whatever logic you're testing works with both sync and async impls.
  
  If you're writing a test that only cares about the sync impl, you should
  probably just call `step_prepare.prepare_sync` directly.
code: def _bg_prepare_sync(
      step_prepare: StepPrepare, *args, **kwargs
  ) -> "concurrent.futures.Future[ResponsePrepare]":
      """Starts prepare_sync running in the background.
  
      Don't call this directly; use the `prepare` fixture instead, to ensure that
      whatever logic you're testing works with both sync and async impls.
  
      If you're writing a test that only cares about the sync impl, you should
      probably just call `step_prepare.prepare_sync` directly.
      """
      enqueued = threading.Event()
      future = concurrent.futures.Future()
  
      def prepare_and_resolve():
          q = step_prepare.prepare_sync(*args, **kwargs)
          enqueued.set()
          future.set_result(q.get())
  
      threading.Thread(
          name="prepare_and_resolve",
          target=prepare_and_resolve,
          daemon=True,
      ).start()
  
      enqueued.wait()
      return future
  
imports: import asyncio
  import concurrent.futures
  import dataclasses
  import queue
  import threading
  from typing import TYPE_CHECKING, Iterable, Mapping, Tuple
  from unittest.mock import Mock, call
  import pytest
  from wandb.filesync.step_prepare import Request, RequestFinish, RequestPrepare, ResponsePrepare, StepPrepare, gather_batch
label_desc: Use image node_id 1 for calling the TestStepPrepare obj's underlying member method code with example usage: obj._bg_prepare_sync(step_prepare) and returns: future