test_spiceThreadSafety

test_spiceThreadSafety.create_load_destroy_spice(worker_id, iterations, dataPath)[source]

Repeatedly create, load, and destroy SpiceInterface objects. This function will be run in parallel by multiple processes.

Parameters:
  • worker_id – ID of this worker process

  • iterations – Number of iterations to perform

  • dataPath – Path to SPICE data directory

test_spiceThreadSafety.get_file_hash(file_path)[source]

Calculate SHA-1 hash of a file to check for corruption.

test_spiceThreadSafety.run_thread_safety_test(num_workers=2, iterations_per_worker=5)[source]

Run the SPICE thread safety test.

Parameters:
  • num_workers – Number of parallel workers

  • iterations_per_worker – Number of iterations per worker

Returns:

Dictionary with test results success: True if all operations completed successfully

Return type:

results

test_spiceThreadSafety.test_spice_thread_safety(show_plots, num_workers, iterations)[source]

Test the thread safety of SPICE interface

Parameters:
  • show_plots – Pytest fixture, not used but required

  • num_workers – Number of parallel workers to use

  • iterations – Number of kernel load/unload iterations per worker