test_spiceThreadSafety

test_spiceThreadSafety.createLoadDestroySpice(workerId, iterations, dataPath)[source]

Repeatedly create, reset, and destroy SpiceInterface objects.

This function is run in parallel by multiple processes. Each worker performs iterations cycles of:

  1. Constructing a SpiceInterface

  2. Configuring planet names and SPICE data path

  3. Calling Reset (which triggers kernel loads)

  4. Brief sleep to increase contention

  5. Deleting the interface (allowing kernels to be released)

Parameters:
  • workerId (int) – Identifier for this worker process.

  • iterations (int) – Number of create/reset/destroy cycles to perform.

  • dataPath (str) – Directory containing SPICE kernel data.

Returns:

Summary for this worker with counts of successes, failures, and a list of captured exception details.

Return type:

dict

test_spiceThreadSafety.runThreadSafetyTest(numWorkers=2, iterationsPerWorker=5)[source]

Run the SPICE thread-safety stress test.

Parameters:
  • numWorkers (int) – Number of parallel worker processes to launch.

  • iterationsPerWorker (int) – Number of create/reset/destroy cycles per worker.

Returns:

  • results (dict) – Aggregate statistics over all workers.

  • success (bool) – True if all iterations completed without failure, False otherwise.

test_spiceThreadSafety.testSpiceThreadSafety(numWorkers, iterationsPerWorker)[source]

Pytest entry point for the SPICE thread-safety test.

Parameters:
  • numWorkers (int) – Number of parallel worker processes.

  • iterationsPerWorker (int) – Number of load/unload cycles per worker.