internal/exectracetest: port database/sql test to the new parser #2790
+169
−26
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.
What does this PR do?
Port the contrib/database/sql execution tracer test to use the new
golang.org/x/exp/trace parser. The test is slightly cleaned up, but for
the most part covers the same logic as its predecessor (see #2060). The
primary difference is that, rather than hooking into a mock database/sql
driver, we use a real one (sqlite3). To simulate a slow operation, the
test registers a sleep function and also sleeps on connection. The
purpose of this is to ensure, where we can, the tracer tasks cover the
whole operation and not just the end of it. We no longer hook into
every operation, though, so we drop some time assertions.
Motivation
To ensure that our execution tracing integration works properly with
contrib/database/sql, and that it is tested in a way that will keep up with
future changes to the execution tracer.
Reviewer's Checklist
Unsure? Have a question? Request a review!