setTracerForTest

Safely sets a custom tracer for testing.