Skip to content

Commit cccb433

Browse files
authored
[chore] Fix flaky k8s objects functional test (#1708)
1 parent 0c393ec commit cccb433

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

functional_tests/k8sevents/k8sevents_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ func Test_K8SEvents(t *testing.T) {
9696
// the following attributes are added by the k8sattributes processor which might not be ready when the test runs
9797
removeFlakyLogRecordAttr(k8sObjectsLogs, "container.image.name")
9898
removeFlakyLogRecordAttr(k8sObjectsLogs, "container.image.tag")
99+
removeFlakyLogRecordAttr(k8sObjectsLogs, "k8s.node.name")
100+
removeFlakyLogRecordAttr(k8sObjectsLogs, "k8s.pod.name")
101+
removeFlakyLogRecordAttr(k8sObjectsLogs, "k8s.pod.uid")
99102

100103
expectedObjectsLogsFile := "testdata/expected_k8sobjects.yaml"
101104
expectedObjectsLogs, err := golden.ReadLogs(expectedObjectsLogsFile)
@@ -106,7 +109,6 @@ func Test_K8SEvents(t *testing.T) {
106109
plogtest.IgnoreObservedTimestamp(),
107110
plogtest.IgnoreResourceAttributeValue("host.name"),
108111
plogtest.IgnoreLogRecordAttributeValue("k8s.object.uid"),
109-
plogtest.IgnoreLogRecordAttributeValue("k8s.pod.uid"),
110112
plogtest.IgnoreLogRecordAttributeValue("k8s.object.resource_version"),
111113
plogtest.IgnoreResourceAttributeValue("com.splunk.index"), // this is flaky, the index can be the value from pod annotation due to the k8sattributes processor in the pipeline or main
112114
plogtest.IgnoreResourceLogsOrder(),

functional_tests/k8sevents/testdata/expected_k8sobjects.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ resourceLogs:
3131
- key: k8s.namespace.name
3232
value:
3333
stringValue: k8sevents-test
34-
- key: k8s.node.name
35-
value:
36-
stringValue: kind-control-plane
37-
- key: k8s.pod.name
38-
value:
39-
stringValue: k8sevents-test-0
40-
- key: k8s.pod.uid
41-
value:
42-
stringValue: ce3f6e1c-f11a-404d-bfd3-5f41811f9133
4334
- key: k8s.resource.name
4435
value:
4536
stringValue: services

0 commit comments

Comments
 (0)