-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Upgrade storage integration test: Use V2 Archive ReaderWriter #6489
Draft
ekefan
wants to merge
10
commits into
jaegertracing:main
Choose a base branch
from
ekefan:archive-reader-writer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+43
−24
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
94ad08c
Resolve merge conflict
ekefan a24df6a
Resolve merge conflict
ekefan 1802271
Resolve merge conflicts
ekefan 549aff2
Resolve merge conflict
ekefan f807b46
Resolve merge conflict
ekefan 9d8bd3a
format code properly
ekefan 3315b6f
Fix lint errors
ekefan 9370cae
Debug: Use archive span reader when trace reader fails
ekefan 42572fa
fix lint
ekefan 54a0a07
Debug: Use archive span reader when trace reader fails
ekefan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,14 +44,15 @@ var fixtures embed.FS | |
// Some implementations may declare multiple tests, with different settings, | ||
// and RunAll() under different conditions. | ||
type StorageIntegration struct { | ||
TraceWriter tracestore.Writer | ||
TraceReader tracestore.Reader | ||
ArchiveSpanReader spanstore.Reader | ||
ArchiveSpanWriter spanstore.Writer | ||
DependencyWriter dependencystore.Writer | ||
DependencyReader depstore.Reader | ||
SamplingStore samplingstore.Store | ||
Fixtures []*QueryFixtures | ||
TraceWriter tracestore.Writer | ||
TraceReader tracestore.Reader | ||
ArchiveTraceReader tracestore.Reader | ||
ArchiveSpanReader spanstore.Reader | ||
ArchiveTraceWriter tracestore.Writer | ||
DependencyWriter dependencystore.Writer | ||
DependencyReader depstore.Reader | ||
SamplingStore samplingstore.Store | ||
Fixtures []*QueryFixtures | ||
|
||
// TODO: remove this after all storage backends return spanKind from GetOperations | ||
GetOperationsMissingSpanKind bool | ||
|
@@ -190,25 +191,36 @@ func (s *StorageIntegration) testArchiveTrace(t *testing.T) { | |
} | ||
defer s.cleanUp(t) | ||
tID := model.NewTraceID(uint64(11), uint64(22)) | ||
expected := &model.Span{ | ||
expectedSpan := &model.Span{ | ||
OperationName: "archive_span", | ||
StartTime: time.Now().Add(-time.Hour * 72 * 5).Truncate(time.Microsecond), | ||
TraceID: tID, | ||
SpanID: model.NewSpanID(55), | ||
References: []model.SpanRef{}, | ||
Process: model.NewProcess("archived_service", model.KeyValues{}), | ||
} | ||
expectedTrace := &model.Trace{ | ||
Spans: []*model.Span{ | ||
expectedSpan, | ||
}, | ||
} | ||
require.NoError(t, s.ArchiveTraceWriter.WriteTraces(context.Background(), v1adapter.V1TraceToOtelTrace(expectedTrace))) | ||
|
||
require.NoError(t, s.ArchiveSpanWriter.WriteSpan(context.Background(), expected)) | ||
|
||
var actual *model.Trace | ||
var actualTrace *model.Trace | ||
found := s.waitForCondition(t, func(_ *testing.T) bool { | ||
var err error | ||
actual, err = s.ArchiveSpanReader.GetTrace(context.Background(), spanstore.GetTraceParameters{TraceID: tID}) | ||
return err == nil && len(actual.Spans) == 1 | ||
iterTraces := s.ArchiveTraceReader.GetTraces(context.Background(), tracestore.GetTraceParams{TraceID: tID.ToOTELTraceID()}) | ||
traces, err := v1adapter.V1TracesFromSeq2(iterTraces) | ||
if len(traces) > 0 { | ||
actualTrace = traces[0] | ||
} else { | ||
actualTrace, err = s.ArchiveSpanReader.GetTrace(context.Background(), spanstore.GetTraceParameters{TraceID: tID}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with span reader, the archive span test(specifically) doesn't fail, |
||
} | ||
|
||
return err == nil && len(actualTrace.Spans) == 1 | ||
}) | ||
require.True(t, found) | ||
CompareTraces(t, &model.Trace{Spans: []*model.Span{expected}}, actual) | ||
CompareTraces(t, expectedTrace, actualTrace) | ||
} | ||
|
||
func (s *StorageIntegration) testGetLargeSpan(t *testing.T) { | ||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the plan is not to get this merged, I just wanted to show you somthing:
the segfaults occured because the ArchiveTraceReader wasn't reading the spans, so `actualTrace1 remained nil, hence the errors when trying to read the spans
but that doesn't occur with the archive span reader...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a tip - if you don't think the PR is ready for merge, you can convert it to a Draft. I would still get a notification of all changes because I subscribe to all, but it won't be saying "Ready for review".