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
iterationscycles of:Constructing a SpiceInterface
Configuring planet names and SPICE data path
Calling Reset (which triggers kernel loads)
Brief sleep to increase contention
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.