code: def test_make_async_gen_fail():
      """Tests that any errors raised in async threads are propagated to the main
      thread."""
  
      def gen(base_iterator):
          raise ValueError("Fail")
  
      iterator = make_async_gen(base_iterator=iter([1]), fn=gen)
  
      with pytest.raises(ValueError) as e:
          for _ in iterator:
              pass
  
      assert e.match("Fail")
  
imports: import threading
  import time
  import numpy
  import pandas
  import pyarrow
  import pytest
  import ray
  from ray.data._internal.block_batching.interfaces import Batch
  from ray.data._internal.block_batching.util import _calculate_ref_hits, blocks_to_batches, collate, finalize_batches, format_batches, resolve_block_refs
  from ray.data._internal.util import Queue, make_async_gen
label_desc: Use image node_id 7 for calling a global function with example usage: test_make_async_gen_fail() without return types