Skip to content

Commit 16f3e68

Browse files
committed
Add test for cyclic connector use.
1 parent b863577 commit 16f3e68

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

otelcol/collector_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,14 @@ func TestCollectorDryRun(t *testing.T) {
511511
},
512512
expectedErr: `failed to build pipelines: connector "nop/connector1" used as exporter in [logs/in2] pipeline but not used in any supported receiver pipeline`,
513513
},
514+
"cyclic_connector": {
515+
settings: CollectorSettings{
516+
BuildInfo: component.NewDefaultBuildInfo(),
517+
Factories: nopFactories,
518+
ConfigProviderSettings: newDefaultConfigProviderSettings(t, []string{filepath.Join("testdata", "otelcol-cyclic-connector.yaml")}),
519+
},
520+
expectedErr: `failed to build pipelines: cycle detected: connector "nop/forward" (traces to traces) -> connector "nop/forward" (traces to traces)`,
521+
},
514522
}
515523

516524
for name, test := range tests {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
receivers:
2+
nop:
3+
4+
exporters:
5+
nop:
6+
7+
connectors:
8+
nop/forward:
9+
10+
service:
11+
pipelines:
12+
traces/in:
13+
receivers: [nop/forward]
14+
processors: [ ]
15+
exporters: [nop/forward]
16+
traces/out:
17+
receivers: [nop/forward]
18+
processors: [ ]
19+
exporters: [nop/forward]

0 commit comments

Comments
 (0)