TestDistributedTracing goldfile approach#4529
Open
dsmiley wants to merge 3 commits into
Open
Conversation
Goal: make it easy & insightful to maintain TestDistributedTracing Risk: determinism
…erminism in what we test
Contributor
Author
|
Gonna merge this Monday if no feedback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal: make it easy & insightful to maintain TestDistributedTracing
Risk: determinism is hard
I hate maintaining TestDistributedTracing... it kills my motivation to work on tracing. One might say nowadays just let Claude do it but that's a cop-out. I want to test observability by examining observability in data form (e.g. json), asserting that the data is what we expect it to be. I do not want to maintain bespoke unit test assertions that try to look at certain aspects of the data.
I recognize this has challenges... basically determinism. But we can combat that -- fix the seed, lay out the replicas in a specified order (deterministic leader not random)... and we can scrub/normalize values that are likely to vary (e.g. containing host/port). And this whole approach requires some test infra -- some non-trivial code. Personally, I'd rather maintain that any day over the status quo. Furthermore, if somebody makes some change that breaks this test, it needs to be super easy to know how to regenerate it. I think the test infra here shows that it's easy. I've done a similar setup conceptually at my day job for something different.
Testing against data leads to insights, positive and negative, that are absent when we only have bespoke assertions. Seeing data sheds a light on what's great and what needs work. For example, it's apparent we don't have enough information in some of the spans to understand what that request was all about (e.g. a distributed search "purpose" or what indexing may or may not have happened on an /update).