Skip to content

Commit bc36508

Browse files
committed
tests: enable distributed tracing tests on 5.15 ci tests
1 parent e38b98f commit bc36508

File tree

6 files changed

+30
-54
lines changed

6 files changed

+30
-54
lines changed

bpf/common/trace_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static __always_inline unsigned char *bpf_strstr_tp_loop__legacy(unsigned char *
9696
return NULL;
9797
}
9898

99-
const u16 k_besteffort_max_loops = 450; // Limited best-effort search to stay within insns limit
99+
const u16 k_besteffort_max_loops = 400; // Limited best-effort search to stay within insns limit
100100
for (u16 i = 0; i + TRACE_PARENT_HEADER_LEN < k_besteffort_max_loops; i++) {
101101
if (i != 0 && buf[i - 1] != '\n') {
102102
continue;

test/integration/multiprocess_test.go

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,13 @@ func TestMultiProcess(t *testing.T) {
9999
assert.Empty(t, results)
100100
})
101101

102-
if kprobeTracesEnabled() {
103-
t.Run("Nested traces with kprobes: rust -> java -> node -> go -> go jsonrpc -> python -> rails", func(t *testing.T) {
104-
testNestedHTTPTracesKProbes(t)
105-
})
106-
107-
t.Run("Nested traces with kprobes: SSL node python rails", func(t *testing.T) {
108-
testNestedHTTPSTracesKProbes(t)
109-
})
110-
}
102+
t.Run("Nested traces with kprobes: rust -> java -> node -> go -> go jsonrpc -> python -> rails", func(t *testing.T) {
103+
testNestedHTTPTracesKProbes(t)
104+
})
105+
106+
t.Run("Nested traces with kprobes: SSL node python rails", func(t *testing.T) {
107+
testNestedHTTPSTracesKProbes(t)
108+
})
111109

112110
t.Run("Instrumented processes metric", func(t *testing.T) {
113111
checkInstrumentedProcessesMetric(t)
@@ -124,11 +122,9 @@ func TestMultiProcessAppCP(t *testing.T) {
124122
compose.Env = append(compose.Env, `OTEL_EBPF_BPF_DISABLE_BLACK_BOX_CP=1`, `OTEL_EBPF_BPF_CONTEXT_PROPAGATION=all`, `OTEL_EBPF_BPF_TRACK_REQUEST_HEADERS=1`)
125123
require.NoError(t, compose.Up())
126124

127-
if kprobeTracesEnabled() {
128-
t.Run("Nested traces with kprobes: rust -> java -> node -> go -> go jsonrpc -> python -> rails", func(t *testing.T) {
129-
testNestedHTTPTracesKProbes(t)
130-
})
131-
}
125+
t.Run("Nested traces with kprobes: rust -> java -> node -> go -> go jsonrpc -> python -> rails", func(t *testing.T) {
126+
testNestedHTTPTracesKProbes(t)
127+
})
132128
require.NoError(t, compose.Close())
133129
}
134130

@@ -141,11 +137,10 @@ func TestMultiProcessAppCPNoIP(t *testing.T) {
141137

142138
require.NoError(t, compose.Up())
143139

144-
if kprobeTracesEnabled() {
145-
t.Run("Nested traces with kprobes: rust -> java -> node -> go -> go jsonrpc -> python -> rails", func(t *testing.T) {
146-
testNestedHTTPTracesKProbes(t)
147-
})
148-
}
140+
t.Run("Nested traces with kprobes: rust -> java -> node -> go -> go jsonrpc -> python -> rails", func(t *testing.T) {
141+
testNestedHTTPTracesKProbes(t)
142+
})
143+
149144
require.NoError(t, compose.Close())
150145
}
151146

test/integration/red_test_nodeclient.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ func testNodeClientWithMethodAndStatusCode(t *testing.T, method string, statusCo
100100
We check that the traceID has that 16 character 0 suffix and then we
101101
use the first 16 characters for looking up by Parent span.
102102
*/
103-
if kprobeTracesEnabled() {
104-
assert.NotEmpty(t, span.TraceID)
105-
assert.Truef(t, strings.HasSuffix(span.TraceID, traceIDLookup),
106-
"string %q should have suffix %q", span.TraceID, traceIDLookup)
107-
}
103+
assert.NotEmpty(t, span.TraceID)
104+
assert.Truef(t, strings.HasSuffix(span.TraceID, traceIDLookup),
105+
"string %q should have suffix %q", span.TraceID, traceIDLookup)
108106
}

test/integration/red_test_rust.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ func testREDMetricsForRustHTTPLibrary(t *testing.T, url, comm, namespace string,
8787
require.Len(t, res, 1)
8888
parent := res[0]
8989
require.NotEmpty(t, parent.TraceID)
90-
if kprobeTracesEnabled() {
91-
require.Equal(t, traceID, parent.TraceID)
92-
// Validate that "parent" is a CHILD_OF the traceparent's "parent-id"
93-
childOfPID := trace.ChildrenOf(parentID)
94-
require.Len(t, childOfPID, 1)
95-
}
90+
require.Equal(t, traceID, parent.TraceID)
91+
92+
// Validate that "parent" is a CHILD_OF the traceparent's "parent-id"
93+
childOfPID := trace.ChildrenOf(parentID)
94+
require.Len(t, childOfPID, 1)
95+
9696
require.NotEmpty(t, parent.SpanID)
9797
// check duration is at least 2us
9898
assert.Less(t, (2 * time.Microsecond).Microseconds(), parent.Duration)

test/integration/suites_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,9 @@ import (
1414

1515
"github.com/stretchr/testify/require"
1616

17-
"go.opentelemetry.io/obi/pkg/obi"
1817
"go.opentelemetry.io/obi/test/integration/components/docker"
1918
)
2019

21-
func kprobeTracesEnabled() bool {
22-
major, minor := obi.KernelVersion()
23-
24-
return major > 5 || (major == 5 && minor >= 17)
25-
}
26-
2720
func TestSuite(t *testing.T) {
2821
compose, err := docker.ComposeSuite("docker-compose.yml", path.Join(pathOutput, "test-suite.log"))
2922
require.NoError(t, err)
@@ -507,11 +500,6 @@ func TestSuite_OverrideServiceName(t *testing.T) {
507500
}
508501

509502
func TestSuiteNodeClient(t *testing.T) {
510-
if !kprobeTracesEnabled() {
511-
t.Skip("distributed traces not supported")
512-
return
513-
}
514-
515503
compose, err := docker.ComposeSuite("docker-compose-nodeclient.yml", path.Join(pathOutput, "test-suite-nodeclient.log"))
516504
require.NoError(t, err)
517505

@@ -524,11 +512,6 @@ func TestSuiteNodeClient(t *testing.T) {
524512
}
525513

526514
func TestSuiteNodeClientTLS(t *testing.T) {
527-
if !kprobeTracesEnabled() {
528-
t.Skip("distributed traces not supported")
529-
return
530-
}
531-
532515
compose, err := docker.ComposeSuite("docker-compose-nodeclient.yml", path.Join(pathOutput, "test-suite-nodeclient-tls.log"))
533516
require.NoError(t, err)
534517

test/integration/traces_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,12 @@ func testHTTPTracesKProbes(t *testing.T) {
333333
require.Len(t, res, 1)
334334
parent := res[0]
335335
require.NotEmpty(t, parent.TraceID)
336-
if kprobeTracesEnabled() {
337-
require.Equal(t, traceID, parent.TraceID)
338-
// Validate that "parent" is a CHILD_OF the traceparent's "parent-id"
339-
childOfPID := trace.ChildrenOf(parentID)
340-
require.Len(t, childOfPID, 1)
341-
}
336+
require.Equal(t, traceID, parent.TraceID)
337+
338+
// Validate that "parent" is a CHILD_OF the traceparent's "parent-id"
339+
childOfPID := trace.ChildrenOf(parentID)
340+
require.Len(t, childOfPID, 1)
341+
342342
require.NotEmpty(t, parent.SpanID)
343343
// check duration is at least 2us
344344
assert.Less(t, (2 * time.Microsecond).Microseconds(), parent.Duration)

0 commit comments

Comments
 (0)