code: def test_exit_on_crash_finite():
      def _exit_finite():
          dataset = DummyDataset(100)
  
          with DataQueue(dataset, producer_num_workers=4) as data_queue:
              time.sleep(3)
              raise ValueError
  
          # https://stackoverflow.com/questions/34506638/how-to-register-atexit-function-in-pythons-multiprocessing-subprocess
  
      process = multiprocessing.Process(target=_exit_finite)
      process.start()
      process.join()
  
file_path: qlib/tests/rl/test_data_queue.py
imports: import multiprocessing
  import time
  import numpy
  import pandas
  from torch.utils.data import Dataset, DataLoader
  from qlib.rl.utils.data_queue import DataQueue
label_desc: Use image node_id 5 for calling a global function with example usage: test_exit_on_crash_finite() without return types