Skip to content

Flaky TestGatedFeatures/ServiceMonitorStatusWithMultipleWorkloads #8028

@simonpasquier

Description

@simonpasquier

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Description

Recently the TestGatedFeatures/ServiceMonitorStatusWithMultipleWorkloads test has been failing from time to time.

From a first investigation, there's a race condition when a configuration resource is selected by 2 workloads and their reconciliation loops try to add their respective binding at the same time:

// Initialize the workload bindings.
return json.Marshal(patch{
patchOperation{
Op: "add",
Path: "/status",
Value: monitoringv1.ConfigResourceStatus{
Bindings: []monitoringv1.WorkloadBinding{binding},
},
},
})

If the patch operations happen simultaneously, the last one wins.

Prometheus Operator Version

main

Kubernetes Version

N/A

Kubernetes Cluster Type

kind

How did you deploy Prometheus-Operator?

yaml manifests

Manifests

prometheus-operator log output

N/A

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions