Skip to content

client: Improve tracing tests

Patrick Steinhardt requested to merge pks-test-dial-improve-test into master

Gitaly allows to set up global tracing, which may create spans for several events. Each span denotes the start and end point, what is happening and some arbitrary baggage which is user-defined.

We have a test which exercises this code and asserts that spans are correctly created and registered across RPC calls, but the test is flaky and causes lots of CI failures. The failure mode is kind of weird, in that spans sometimes have a different order than the order we expect.

It is unclear what exactly is causing the races, and personally I have not been able to reproduce it locally. This commit thus refactors both testcases and makes them more explicit about what kind of data they expect, which hopefully helps in nailing down what's happening.

One thing that may be a potential source of the bug is that we now flush the tracer earlier. Previously, we'd only close the tracer after the testcase ran. But given that the close may also flush any pending events, this could potentially be a source of uncertainty.

Merge request reports

Loading