This should fix (with a fairly gross hack...) the data race that's currently preventing other fixes.
In this case, the problem is with a data race that is only possible in tests, and then only with tests that are run from the same internal package (i.e., package lightstep). The tests currently write to the tracer's internal state after the tracer has been constructed, which is being accessed concurrently by the run loop that starts during construction.
A "better" fix might be to refactor, e.g., to use an internal package. While this may be an architecturally preferable route, it doesn't make sense to invest in a large change with OpenTelemetry on the horizon.
This should fix (with a fairly gross hack...) the data race that's currently preventing other fixes.
In this case, the problem is with a data race that is only possible in tests, and then only with tests that are run from the same internal package (i.e.,
package lightstep
). The tests currently write to the tracer's internal state after the tracer has been constructed, which is being accessed concurrently by the run loop that starts during construction.A "better" fix might be to refactor, e.g., to use an
internal
package. While this may be an architecturally preferable route, it doesn't make sense to invest in a large change with OpenTelemetry on the horizon.