Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky unit tests in CI #417

Closed
furkatgofurov7 opened this issue Aug 27, 2024 · 1 comment · Fixed by #547
Closed

Flaky unit tests in CI #417

furkatgofurov7 opened this issue Aug 27, 2024 · 1 comment · Fixed by #547
Labels
area/ci Issues or PRs related to CI kind/bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@furkatgofurov7
Copy link
Contributor

What happened:
Looks like the ci job run ci checks flakes a lot in PRs time to time with mainly 2 different errors:

  1. https://github.com/rancher/cluster-api-provider-rke2/blob/main/controlplane/internal/controllers/rke2controlplane_controller_test.go#L229-L250
• [FAILED] [3.335 seconds]
Reconclie control plane conditions [BeforeEach] should reconcile cp and machine conditions successfully
  [BeforeEach] /home/runner/work/cluster-api-provider-rke2/cluster-api-provider-rke2/controlplane/internal/controllers/rke2controlplane_controller_test.go:35
  [It] /home/runner/work/cluster-api-provider-rke2/cluster-api-provider-rke2/controlplane/internal/controllers/rke2controlplane_controller_test.go:229

  [FAILED] Timed out after 1.000s.
  Expected success, but got an error:
      <*errors.StatusError | 0xc000[43](https://github.com/rancher/cluster-api-provider-rke2/actions/runs/10576900841/job/29303887583#step:6:44)0aa0>: 
      Node "ref-node" not found
      {
          ErrStatus: {
              TypeMeta: {Kind: "", APIVersion: ""},
              ListMeta: {
                  SelfLink: "",
                  ResourceVersion: "",
                  Continue: "",
                  RemainingItemCount: nil,
              },
              Status: "Failure",
              Message: "Node \"ref-node\" not found",
              Reason: "NotFound",
              Details: {Name: "ref-node", Group: "", Kind: "Node", UID: "", Causes: nil, RetryAfterSeconds: 0},
              Code: 404,
          },
      }
  In [BeforeEach] at: /home/runner/work/cluster-api-provider-rke2/cluster-api-provider-rke2/controlplane/internal/controllers/rke2controlplane_controller_test.go:138 @ 08/27/24 11:14`
  1. https://github.com/rancher/cluster-api-provider-rke2/blob/main/pkg/rke2/workload_cluster_test.go#L267-L309
• [FAILED] [0.023 seconds]
Node metadata propagation [It] should set the node annotations for an arbitrary node reference
/home/runner/work/cluster-api-provider-rke2/cluster-api-provider-rke2/pkg/rke2/workload_cluster_test.go:2[67](https://github.com/rancher/cluster-api-provider-rke2/actions/runs/10576429368/job/29302746680#step:6:68)

  [FAILED] Expected
      <map[string]string | len:1>: {
          "cluster.x-k8s.io/machine": "other-machine",
      }
  to equal
      <map[string]string | len:2>: {
          "cluster.x-k8s.io/machine": "other-machine",
          "test": "true",
      }
  In [It] at: /home/runner/work/cluster-api-provider-rke2/cluster-api-provider-rke2/pkg/rke2/workload_cluster_test.go:305 @ 08/27/24 10:48:29.9[76](https://github.com/rancher/cluster-api-provider-rke2/actions/runs/10576429368/job/29302746680#step:6:77)

What did you expect to happen:
make test always pass without flakes

How to reproduce it:
Can be hit if run locally multiple times or in the CI:

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • rke provider version: v0.5.0
  • OS (e.g. from /etc/os-release): macOS
@furkatgofurov7 furkatgofurov7 added kind/bug Something isn't working needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/accepted Indicates an issue or PR is ready to be actively worked on. area/ci Issues or PRs related to CI and removed needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 27, 2024
Copy link

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 26, 2024
@alexander-demicev alexander-demicev removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 3, 2025
@kkaempf kkaempf added this to the v0.11.0 milestone Jan 3, 2025
@alexander-demicev alexander-demicev moved this to CAPI Backlog in CAPI / Turtles Jan 3, 2025
@github-project-automation github-project-automation bot moved this from CAPI Backlog to Done in CAPI / Turtles Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci Issues or PRs related to CI kind/bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants