Skip to content

Commit 8e2db5f

Browse files
authored
[chore] Fix mutability assertion loops (#10627)
I noticed that these loops are making the same assertion repeatedly, rather than checking each element.
1 parent a521428 commit 8e2db5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

service/internal/graph/graph_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ func TestConnectorPipelinesGraph(t *testing.T) {
955955
expected.MarkReadOnly() // multiple read-only exporters should get read-only pdata
956956
}
957957
for i := 0; i < test.expectedPerExporter; i++ {
958-
assert.EqualValues(t, expected, tracesExporter.Traces[0])
958+
assert.EqualValues(t, expected, tracesExporter.Traces[i])
959959
}
960960
}
961961
for _, e := range allExporters[component.DataTypeMetrics] {
@@ -966,7 +966,7 @@ func TestConnectorPipelinesGraph(t *testing.T) {
966966
expected.MarkReadOnly() // multiple read-only exporters should get read-only pdata
967967
}
968968
for i := 0; i < test.expectedPerExporter; i++ {
969-
assert.EqualValues(t, expected, metricsExporter.Metrics[0])
969+
assert.EqualValues(t, expected, metricsExporter.Metrics[i])
970970
}
971971
}
972972
for _, e := range allExporters[component.DataTypeLogs] {
@@ -977,7 +977,7 @@ func TestConnectorPipelinesGraph(t *testing.T) {
977977
expected.MarkReadOnly() // multiple read-only exporters should get read-only pdata
978978
}
979979
for i := 0; i < test.expectedPerExporter; i++ {
980-
assert.EqualValues(t, expected, logsExporter.Logs[0])
980+
assert.EqualValues(t, expected, logsExporter.Logs[i])
981981
}
982982
}
983983
})

0 commit comments

Comments
 (0)