cluster-api-provider-vsphere icon indicating copy to clipboard operation
cluster-api-provider-vsphere copied to clipboard

Refine context in unit test

Open zhanggbj opened this issue 2 years ago • 2 comments
trafficstars

/kind bug

What steps did you take and what happened: [A clear and concise description of what the bug is.] Revisit the unit test and setup separate context for different test file or even test case based on specific scenario, instead of using the test-package variable here. We're seeing flaky errors in CI. This helps ensure that test case is kind of isolated and independent from others, which can make predictable and reliable test results.

  • Move https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/d420ebd66a1709b899da1c73888ec5e08ba6f0b9/controllers/controllers_suite_test.go#L49 into the setup() function and use context.Background in the other functions which did refer this context.

What did you expect to happen:

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

Environment:

  • Cluster-api-provider-vsphere version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

zhanggbj avatar Nov 15 '23 08:11 zhanggbj

Let's hold this work until we are sure about why it happened in 269023424b03a8c029ad95b605f0b6bf9431f9a3..b00e9811fd246af7a9e03676d9577b8ef56106d0 (compare) and if this would bring a benefit at all

chrischdi avatar Dec 06 '23 10:12 chrischdi

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Mar 05 '24 10:03 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Apr 04 '24 11:04 k8s-triage-robot

I think we're fine now given unit tests are stable without it

/close

sbueringer avatar Apr 18 '24 13:04 sbueringer

@sbueringer: Closing this issue.

In response to this:

I think we're fine now given unit tests are stable without it

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Apr 18 '24 13:04 k8s-ci-robot